安卓开发笔记(二十七):实现文字下方轮播消息文字

仅仅写个xml就够了,真简单啊

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:background="@drawable/timg"
    tools:context=".MainActivity">
    <TextView
        android:layout_marginTop="200dp"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="想看妹子吗?身为男人不想看妹子怕是个沙雕吧,本站提供丰富的妹子资源,尽请享受"
        android:textColor="@color/colorAccent"
<!--         下面开始对于轮播的设置         -->
        android:singleLine="true"<!--是否单行显示-->
        android:ellipsize="marquee"<!--超出部分进行轮播显示 -->
        android:focusable="true"<!-- 下面这两个属性和焦点有关,反正设置为true就好了-->
        android:focusableInTouchMode="true"
<!--     轮播设置完毕            -->
        android:padding="20dp"/>

</LinearLayout>

猜你喜欢

转载自www.cnblogs.com/geeksongs/p/10764343.html