关键代码:

        android:singleLine="true"        android:ellipsize="marquee"         android:focusable="true"         android:marqueeRepeatLimit="marquee_forever"         android:focusableInTouchMode="true"         android:scrollHorizontally="true" 

<span style="background-color: rgb(255, 255, 255); color: rgb(85, 85, 85); font-family: 'microsoft yahei'; line-height: 35px;">属性详解:</span>



注意一下这几个属性:

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="很长很长的文本信息,很长很长的文本信息" />


更多相关文章

  1. android inputtype属性
  2. Android(安卓)EditText各种属性及作用
  3. EditText控件常用属性
  4. Android(安卓)EditText各种属性及作用
  5. Android系统启动——7附录1:Android属性系统
  6. Android(安卓)textAppearance的属性设置及TextView属性详解
  7. Android:EditText 多行显示及所有属性
  8. Android(安卓)UI 初学笔记(一)
  9. xml属性

随机推荐

  1. Binder 和 AIDL
  2. Android应用开发UI(日期和时间)
  3. ios中getTime()的兼容性实例代码
  4. Cordova 3.x 基础(13) -- 为Android(安卓)A
  5. Android(安卓)BroadcastRecevicer广播分
  6. Curso Adapter ListView ContextMenu
  7. Android智能下拉刷新框架-SmartRefreshLa
  8. MTK Android(安卓)G sensor 原理,配置,调试
  9. Android(安卓)declare-styleable:自定义控
  10. Android(安卓)最火框架XUtils之注解机制