Android之TextView的跑马灯特效
来源:互联网 发布:在淘宝买散片cpu可靠吗 编辑:程序博客网 时间:2024/04/28 09:45
-----------------转载请注明出处:http://blog.csdn.net/android_cll
一:多话不说,先看看效果图,框起来的地方是可以横着滚动的:
1.xml布局、
<TextView android:id="@+id/chaoshigonggao" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_centerVertical="true" android:layout_marginBottom="5dp" android:layout_marginLeft="10dp" android:layout_marginRight="5dp" android:layout_marginTop="5dp" android:layout_toRightOf="@+id/imggg" android:text="欢迎光临" android:textColor="#ffffff" android:textSize="12dp" />
2.实现跑马灯的方法、
//跑马灯方法public static void setTextMarquee(TextView textView) { if (textView != null) { textView.setEllipsize(TextUtils.TruncateAt.MARQUEE); textView.setSingleLine(true); textView.setSelected(true); textView.setFocusable(true); textView.setFocusableInTouchMode(true); }}
3.调用方法实现效果、
private TextView chaoshigonggao;
chaoshigonggao.setText(后台获取的数据);setTextMarquee(chaoshigonggao);
这个效果是不是很简单。。。。。
3 0
- Android之TextView的跑马灯特效
- TextView自己的跑马灯特效
- android的textView跑马灯
- Android自定义之TextView跑马灯的监听
- Android之TextView实现跑马灯的效果(笔记)
- Android之TextView实现跑马灯的效果(笔记)
- Android控件之跑马灯效果的TextView
- android 之textview滚动,,跑马灯
- Android控件之TextView跑马灯效果
- Android复习之textview跑马灯效果
- Android---自定义Textview之跑马灯
- android TextView跑马灯
- Android TextView跑马灯
- Android TextView跑马灯
- Android TextView 跑马灯
- android TextView显示跑马灯的效果
- Android TextView的跑马灯效果
- Android TextView 跑马灯效果的实现
- Google Gson:POJO 和 JSON 的字段映射规则
- 记录--ztree加载后显示undefined的问题
- Maven项目报错总结
- hibernate 批量处理数据造成oom
- Cocos2d-x3.2 UserDefault用户数据 使用
- Android之TextView的跑马灯特效
- 百度地图开发时:只显示灰色的网格而不显示具体地图信息的解决办法
- LeetCode:Math
- Servlet技术浅析(六)之-----JavaWeb应用的生命周期和Servlet的生命周期
- Lua 变量
- over函数
- Android硬件解码
- nginx功能(1)--目录配置
- Java基础知识总结