TextView 跑马灯
来源:互联网 发布:胡克霍根身体数据 编辑:程序博客网 时间:2024/06/06 03:32
废话不多说:
第一步:
<TextView android:id="@+id/tv_n1" android:layout_width="150dp" android:layout_height="20dp" android:singleLine="true" android:ellipsize="marquee" android:marqueeRepeatLimit="2" android:textSize="18sp" android:text="你好我好大家好!你好我好大家好!你好我好大家好!你好我好大家好!" />
第二步:
在第一步的标签中加入
android:focusableInTouchMode="true"android:focusable="true"
或
在java代码中调用
n1.setSelected(true);
要点
- 虽然android:singleLine被弃用了,代码提示建议使用android:maxLines,但是写android:maxLines =1 他妈不好用啊,你说有多坑。必须写android:singleLine=”true” !
- 在xml中加标签属性 android:textIsSelectable 不好用!
阅读全文
0 0
- TextView实现跑马灯
- TextView 跑马灯
- TextView跑马灯效果
- textview 跑马灯
- TextView跑马灯效果
- TextView实现跑马灯
- TextView跑马灯效果
- 跑马灯TextView
- TextView跑马灯效果
- TextView跑马灯效果
- TextView跑马灯效果
- TextView 跑马灯效果
- TextView 跑马灯效果
- android TextView跑马灯
- Android TextView跑马灯
- TextView跑马灯效果
- TextView跑马灯总汇
- TextView跑马灯效果
- 过滤掉字符串中的非数字
- Leetcode350 Intersection of Two Arrays II &Leetcode Intersection of Two Arrays
- C语言面向对象编程之二:继承
- 20、TensorFlow 中 MNIST 数据集的使用
- 中山大学算法课程题目详解(第九周)
- TextView 跑马灯
- 自定义类型与内存对齐
- 一文读懂卷积神经网络
- JavaScript实现排序和搜索
- dubbo hello world
- #448 div2 a Pizza Separation
- C语言面向对象编程之三:虚函数与多态
- HLS 协议
- PyQt5 runJavaScript的使用