zoukankan      html  css  js  c++  java
  • Android Studio 制作一个循环播报的效果

      这个就是用到了一个TextView 控件,直接上代码。

     1 <TextView
     2         android:id="@+id/tv_7"
     3         android:layout_width="match_parent"
     4         android:layout_height="wrap_content"
     5         android:text="熟能生巧,业精于勤。"
     6         android:textSize="20sp"
     7         android:textColor="@color/colorBlue"
     8         android:singleLine="true"
     9         android:ellipsize="marquee"
    10         android:marqueeRepeatLimit="marquee_forever"
    11         android:focusable="true"
    12         android:focusableInTouchMode="true"
    13         android:layout_alignParentBottom="true"/>

      这里singleLine设置为单行

      ellipsize这只他为当显示不下的时候以 ... 代替

      marqueeRepeatLimit 设置循环次数

      

       1 android:focusable="true" 2 android:focusableInTouchMode="true"  

      聚焦一下,这两行必须要有

  • 相关阅读:
    寒假学习第一天
    课堂测试
    第十六周总结
    第十五周总结
    计算最长单词链
    第十四周总结
    人月神话阅读笔记03
    人月神话阅读笔记02
    第十五周学习进度
    冲刺第二十天
  • 原文地址:https://www.cnblogs.com/yandashan666/p/10419021.html
Copyright © 2011-2022 走看看