码迷,mamicode.com
首页 > 移动开发 > 详细

Android:TextView文字跑马灯的效果实现

时间:2014-12-01 22:24:09      阅读:167      评论:0      收藏:0      [点我收藏+]

标签:android   style   ar   color   sp   on   div   问题   ad   

解决TextView文字显示不全的问题。

  1. 简单设置跑马灯的效果:

<TextView

android:id="@+id/textView"

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:ellipsize="marquee"

android:focusable="true"

android:focusableInTouchMode="true"

android:text="@string/hello_world"

android:singleLine="true" />

2、此方法存在一个问题,多个TextView的话,只有一个显示跑马灯的效果,解决办法是继承TextView类,重写isFocused方法,使之返回真

Android:TextView文字跑马灯的效果实现

标签:android   style   ar   color   sp   on   div   问题   ad   

原文地址:http://www.cnblogs.com/freeabyss/p/4136043.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!