Android开发_TextView跑马灯
16lz
2021-12-04
关键代码:
android:singleLine="true" android:ellipsize="marquee" android:focusable="true" android:marqueeRepeatLimit="marquee_forever" android:focusableInTouchMode="true" android:scrollHorizontally="true"
注意一下这几个属性:
android:focusable=”true”
是指出在得到焦点后触发事件。
android:focusableInTouchMode=”true”
是指不用捞取焦点,就触发事件。也就是説一运行,就触点该事件。
android:singleLine=”true”
是设置TextView只显示一行
实例:
<TextView android:id="@+id/horseRace Lamp" android:layout_width="fill_parent" android:layout_height="wrap_content" android:singleLine="true" android:ellipsize="marquee" android:focusable="true" android:marqueeRepeatLimit="marquee_forever" android:focusableInTouchMode="true" android:scrollHorizontally="true" android:text="很长很长的文本信息,很长很长的文本信息" />
更多相关文章
- android inputtype属性
- Android(安卓)EditText各种属性及作用
- EditText控件常用属性
- Android(安卓)EditText各种属性及作用
- Android系统启动——7附录1:Android属性系统
- Android(安卓)textAppearance的属性设置及TextView属性详解
- Android:EditText 多行显示及所有属性
- Android(安卓)UI 初学笔记(一)
- xml属性