android跑马灯效果

<TextView 
	    android:layout_height="wrap_content"
	    android:layout_width="fill_parent"
	    android:textSize="30px"
	    android:text="hello,my name is linyuhuan,i am come from canada,where are you come from?"
	    android:singleLine="true"       //是否当行显示文本
	    android:ellipsize="marquee"//文本超过控件长度,如何处理文本内容,此处为滚动动画显示
	    android:focusable="true"        //是否获得焦点
	    android:focusableInTouchMode="true"    //是否在触摸模式下获得焦点
	    android:marqueeRepeatLimit="marquee_forever"//重复滚动的次数
	    />

<TextView 

   android:layout_height="wrap_content"    android:layout_width="fill_parent"    android:textSize="30px"    android:text="11111111111111111111111133333333333344444444488888889999999992"    android:singleLine="true"    android:ellipsize="marquee"    android:focusable="true"    android:focusableInTouchMode="true"/>

运行的结果只有第一个有跑马灯效果。

注意:

(1)Android的缺省行为是在控件获得Focus时才会显示走马灯效果

(2)对于一个大View中有很多子View来说,同一时刻只能有一个子View获得focus!也就是说当前这一屏上,最多只能有一个view能有跑马灯效果,而不能多个View同事都有跑马灯效果。








转载于:https://my.oschina.net/u/1189340/blog/178103

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值