Android之实现textvew跑马灯效果
16lz
2021-01-23
<!--
android:singleLine="true" 文字单独一行显示
android:ellipsize="marquee" 表示跑马灯效果 其他属性 end start middle 表示省略号 在textview中显示的位置
android:marqueeRepeatLimit="marquee_forever" 设定滚动的次数
android:focusable="true"
android:focusableInTouchMode="true" -->
<TextView
android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:ellipsize="marquee"
android:marqueeRepeatLimit="marquee_forever"
android:focusable="true"
android:focusableInTouchMode="true"
/>
这样设置好之后就能产生跑马灯的效果。
但是这样设置好之后TextView的超链接功能似乎不能用了。还在测试中。
android:singleLine="true" 文字单独一行显示
android:ellipsize="marquee" 表示跑马灯效果 其他属性 end start middle 表示省略号 在textview中显示的位置
android:marqueeRepeatLimit="marquee_forever" 设定滚动的次数
android:focusable="true"
android:focusableInTouchMode="true" -->
<TextView
android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:ellipsize="marquee"
android:marqueeRepeatLimit="marquee_forever"
android:focusable="true"
android:focusableInTouchMode="true"
/>
这样设置好之后就能产生跑马灯的效果。
但是这样设置好之后TextView的超链接功能似乎不能用了。还在测试中。
更多相关文章
- Android-两种方式实现走马灯效果
- Android动画效果——X、Y轴抖动
- Android横向智能刷新框架-SmartRefreshHorizontal+ScrollView 实
- ListView 滑动边界的模糊效果
- 【Android 界面效果4】android背景选择器selector用法汇总
- android圆形图片显示效果,带边框
- android中动画效果的运用
- android加载效果,带百分比的
- android Gallery3D效果