Android(安卓)TextView走马灯效果
16lz
2021-12-04
布局:
<TextView android:id="@+id/myTextView" android:layout_width="match_parent" android:layout_height="wrap_content" android:ellipsize="marquee" android:marqueeRepeatLimit="marquee_forever" android:scrollHorizontally="true" android:singleLine="true" android:text="hello world my dear friend this is a long long string~~~~hello world my dear friend this is a long long string" />
还需要在程序中进行控制:
TextView mTextView = (TextView) findViewById(R.id.myTextView); // 开始走马灯效果 mTextView.setSelected(true); // 停止走马灯效果 // mTextView.setSelected(false);
更多相关文章
- TextView跑马灯效果
- android TextView实现跑马灯效果
- Android隐藏状态栏和标题栏,相当于全屏效果
- Android设置窗口、控件透明度
- Android下OpenCV的环境搭建
- Android(安卓)ProgressBar进度条,以及自定义显示
- Android(安卓)应用开发笔记 - 拖动效果(Gallery)
- Android(安卓)使用 TableLayout 布局拉伸宽度
- Android菜鸟日记17-SeekBar的图片效果