首页 > 其他 > 详细

让TextView出现跑马灯效果

时间:2015-12-05 12:53:03      阅读:119      评论:0      收藏:0      [点我收藏+]

技术分享

只需要在TextView中添加一些属性即可:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >

    <!-- 实现的属性:ellipsize、focusable、focusableInTouchMode、singleLine -->
    
    <TextView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_marginTop="20dp"
        android:textColor="#9C27B0"
        android:ellipsize="marquee"
        android:focusable="true"
        android:focusableInTouchMode="true"
        android:singleLine="true"
        android:gravity="center"
        android:text="www.cnblogs.com/zzw1994  www.cnblogs.com/zzw1994"
        android:textSize="30sp" />

</LinearLayout>

 

让TextView出现跑马灯效果

原文:http://www.cnblogs.com/zzw1994/p/5021227.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!