Android初学设置文字跑马灯效果

西特张

关注

阅读 93

2022-01-30


在src/main/res/layout/activity_main.xml文件下添加以下代码

<TextView
android:id="@+id/tv_7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"

android:text="往事随风往事随风往事随风往事随风往事随风往事随风"
android:textColor="#000000"
android:textSize="15pt"
android:singleLine="true"
android:ellipsize="marquee"
android:marqueeRepeatLimit="marquee_forever"
tools:ignore="MissingConstraints"
tools:layout_editor_absoluteX="40dp"
tools:layout_editor_absoluteY="343dp"
android:focusable="true"
android:clickable="true"
android:focusableInTouchMode="true"/>

效果图



精彩评论(0)

0 0 举报