Android开发textview中跑马灯效果
2011-08-05 10:07
501 查看
<TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:focusable ="true" android:singleLine="true" android:ellipsize="marquee" android:marqueeRepeatLimit="marquee_forever" android:focusableInTouchMode="true" android:scrollHorizontally="true" android:textSize="24dp" android:text="@string/hello" android:background="@drawable/bg" />
其中实现跑马灯(学过HTML的 应该清楚Marquee滚动)的关键代码为:
<!--激活焦点--> android:focusable="true" <!--单行显示--> android:singleLine="true" <!--这里设置为超出文本后滚动显示--> android:ellipsize="marquee" <!--这个是设置滚动几次,这里是无限循环--> android:marqueeRepeatLimit="marquee_forever" <!--TouchMode模式的焦点激活--> android:focusableInTouchMode="true" <!--横向超出后是否有横向滚动条--> android:scrollHorizontally="true"
相关文章推荐
- Android开发实现TextView跑马灯效果
- Android开发:TextView实现跑马灯效果
- android开发之——设置TextView文本为跑马灯效果
- Android开发实现TextView跑马灯效果
- android开发自定义控件之TextView跑马灯效果
- Android开发 TextView实现跑马灯效果
- Android开发之TextView实现跑马灯效果
- Android开发 第三课 使用TextView实现跑马灯效果
- Android textView点击滚动(跑马灯)效果
- TextView属性android:ellipsize实现跑马灯效果
- 初学者---Android TextView实现跑马灯效果
- Android TextView实现跑马灯效果
- Android控件之TextView跑马灯效果
- android代码库之textview跑马灯效果
- Android中继承TextView实现文字的跑马灯效果
- Android:将TextView设置为跑马灯效果
- Android实现跑马灯效果的TextView
- Android中TextView实现跑马灯效果
- Android中长TextView实现跑马灯效果
- Android TextView 跑马灯效果