用textview实现跑马灯效果
来源:互联网 发布:淘宝商品导入京东 编辑:程序博客网 时间:2024/06/05 04:18
1.在xml中设置textview
<TextView
android:id="@+id/index_maquree_txt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="12sp"
android:textColor="@color/black"
android:layout_centerInParent="true"
android:paddingLeft="8dp"
android:singleLine="true"
android:ellipsize="marquee"
android:marqueeRepeatLimit="marquee_forever"
android:focusable="true"
android:focusableInTouchMode="true"
android:text="@string/index_news1"/>
2.在activity中添加获得焦点,同样focusableInTouchMode是滑动时能否获得焦点。
TextView indexWeather = (TextView)view.findViewById(R.id.index_maquree_txt);
//如果reportContent内容太多了的话,我们需要让其滚动起来,
//具体可以查看SDK中android.text.method了解更多,代码如下:
indexWeather.setMovementMethod(ScrollingMovementMethod.getInstance()) ;
- android用TextView实现跑马灯效果
- 用textview实现跑马灯效果
- 用textView实现跑马灯效果
- 慕课网--用textview实现跑马灯效果
- TextView实现跑马灯效果
- TextView实现跑马灯效果
- TextView实现跑马灯效果
- TextView实现跑马灯效果
- TextView实现跑马灯效果
- TextView实现跑马灯效果
- TextView实现跑马灯效果
- TextView实现跑马灯效果
- TextView实现跑马灯效果
- textview实现跑马灯效果
- TextView实现跑马灯效果
- TextView实现跑马灯效果
- TextView 实现跑马灯效果
- TextView 实现跑马灯效果
- Leetcode[2] Add Two Numbers
- vim 配置方便浏览linux内核文件
- 如何在面试中发现优秀程序员(转)
- 读取其他格式的文件
- 系统函数的零极点
- 用textview实现跑马灯效果
- 修改Android签名证书keystore的密码、别名alias以及别名密码
- Java Socket通信技术收发线程互斥的解决方法
- android PopupWindow
- 动态规划
- 各种checkbox
- 编写伪码步骤:(针对简单程序)做完每一步后再做下一步
- Java多线程(五)之BlockingQueue深入分析及其实现类实现方式分析
- Android 手机数据库存放位置