android在Gridview实现Textview跑马灯效果
来源:互联网 发布:淘宝冰点价 编辑:程序博客网 时间:2024/04/30 04:41
默认是下面的属性添加TextView中:android:ellipsize="marquee" android:focusableInTouchMode="true" android:gravity="center" android:marqueeRepeatLimit="marquee_forever" android:scrollHorizontally="true" android:singleLine="true"但是你会发现无效,并且gridview也不可点击,只有自定义Textview代码如下:
package com.shangc.mycar.custom;import android.content.Context;import android.util.AttributeSet;import android.widget.TextView;/** * 自定义textview实现在GridView实现跑马灯的效果,复写view里面的isFocused()方法,默认情况下是不会有效果的, * 而且gridview也不可点击 * * @author dennis * */public class MyGridViewTextView extends TextView{public MyGridViewTextView(Context context, AttributeSet attrs, int defStyle){super(context, attrs, defStyle);// TODO Auto-generated constructor stub}public MyGridViewTextView(Context context, AttributeSet attrs){super(context, attrs);}@Overridepublic boolean isFocused(){return true;}}使用上面自定义的TextView并且去掉android:focusable="true" 即可。
1 0
- android在Gridview实现Textview跑马灯效果
- 在Gridview中 实现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---14---TextView实现跑马灯效果
- Android TextView实现跑马灯效果。
- android textview 实现跑马灯效果
- 【LeetCode】Decode Ways
- 正则表达式验证是否为中文
- SSH开发中公共接口和实现类
- Jquery 日历控件(可以设置时、分、秒)
- Android之基于XMPP协议即时通讯软件(二)
- android在Gridview实现Textview跑马灯效果
- thinkphp的分页格式自定义
- ubuntu下安装vim7.3
- 堆栈!堆栈!堆、栈的区别
- 新辰:一位90后的电商梦 自述创业失败的教训
- 图解FFMPEG打开媒体的函数avformat_open_input
- cmd文件执行时候一闪而过却看不到错误原因
- 生成缩略图
- using namespace std;