0
点赞
收藏
分享

微信扫一扫

AndroidStudio跑马灯实现

归零者245号 03-10 06:00 阅读 2

在activity_main.xml中编写如下代码:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    >

    <TextView
        android:id="@+id/tv_one"
        android:text="请注意,这只是测试,请注意,这只是测试,请注意,这只是测试,请注意,这只是测试,请注意,这只是测试,"
        android:textColor="#ffffff"
        android:textSize="32sp"
        android:textStyle="italic"
        android:shadowColor="#F3B68888"
        android:shadowRadius="5.0"
        android:shadowDx="10.0"
        android:shadowDy="10.0"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@color/zise"
        android:gravity="center"
        android:ellipsize="marquee"
        android:marqueeRepeatLimit="marquee_forever"
        android:singleLine="true"
        android:focusable="true"
        android:focusableInTouchMode="true"
        >
        <requestFocus/>
    </TextView>
</LinearLayout>

效果如下:

Android跑马灯

相关资料:

举报

相关推荐

0 条评论