<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"

更多相关文章

  1. 垂直跑马灯、滚动通知
  2. 横向滚动条的设置
  3. Android(安卓)之Tab
  4. android 水平 垂直 滚动
  5. Android(安卓)ProgressBar 设置滚动的图标
  6. Android(安卓)ScrollView去掉滚动条及ScrollView属性
  7. Android(安卓)ScrollView去掉滚动条及ScrollView属性
  8. TextView跑马灯效果
  9. android群英传笔记--第四章--ListView使用技巧(一)

随机推荐

  1. Android(安卓)自定义View - 启航 一般Vie
  2. 2013.07.22——— android 修改hosts
  3. Android中的Handler的具体用法
  4. Android使用DialogFragment,自定义对话框
  5. android 设计模式相关内容
  6. Android(安卓)APP之间共享SharedPreferen
  7. 动态设置android:drawableLeft|Right|Top
  8. Android VR效果GoogleVR
  9. Quick_Cocos2d_x V3.3 Protobuf Android
  10. 2012.08.23——— android ndk 编译多个s