如何通过配置布局文件使TextView实现跑马灯效果
2014-11-05 10:31
417 查看
首先,该TextView控件需要包含如下几个关键配置:
<TextView
android:ellipsize="marquee"
android:focusable="true"
android:focusableInTouchMode="true"
android:marqueeRepeatLimit="1"
android:singleLine="true" />
要点:1.TextView只有在获取焦点后才会滚动显示因过长而被隐藏的文字。
所以为了确保在界面上该TextView能够默认获取到焦点,界面上其他控件的focusable不能为true。
一个界面可能是由多个布局文件拼接而成的,所以检查时除了该TextView所在的布局文件外,其他布局文件中的控件也要保证focusable不为true。
<TextView
android:ellipsize="marquee"
android:focusable="true"
android:focusableInTouchMode="true"
android:marqueeRepeatLimit="1"
android:singleLine="true" />
要点:1.TextView只有在获取焦点后才会滚动显示因过长而被隐藏的文字。
所以为了确保在界面上该TextView能够默认获取到焦点,界面上其他控件的focusable不能为true。
一个界面可能是由多个布局文件拼接而成的,所以检查时除了该TextView所在的布局文件外,其他布局文件中的控件也要保证focusable不为true。
相关文章推荐
- Android 如何实现TextView的跑马灯效果,即轮播
- Android之如何用TextView实现滚动字幕的效果【跑马灯】
- 如何将png图片转换成.9.png格式,textview实现跑马灯效果
- TextView布局文件中实现文本过长时滚动显示效果
- TabActivity可以显示实现多页显示效果,在xml布局文件中需要有一些特殊的配置属性
- android TextView实现跑马灯效果
- Android开发 TextView实现跑马灯效果
- android TextView的跑马灯效果的实现
- android在Gridview实现Textview跑马灯效果
- TextView实现跑马灯效果
- 如何实现TextView的Marquee效果
- TextView实现跑马灯效果
- Android中TextView不获取焦点可以实现跑马灯的效果
- Android实现多个TextView同时显示跑马灯效果
- ListView 中的TextView实现跑马灯效果
- Android实现多个TextView同时显示跑马灯效果
- android TextView实现跑马灯效果
- WinPE系统设定如何修改(可通过修改PE注册表或配置文件来实现)
- ListView 中的TextView实现跑马灯效果
- android用TextView实现跑马灯效果