android TextView(5)-TextView一些其他常用效果
来源:互联网 发布:java sleep函数 编辑:程序博客网 时间:2024/06/07 06:26
实现跑马灯效果的TextView
只需要在布局文件中加上属性
android:singleLine="true"android:ellipsize="marquee"android:marqueeRepeatLimit="marquee_forever"android:focusable="true"android:focusableInTouchMode="true"
如下
<TextViewandroid:id="@+id/txtOne"android:layout_width="match_parent"android:layout_height="wrap_content"android:textSize="18sp"android:singleLine="true"android:ellipsize="marquee"android:marqueeRepeatLimit="marquee_forever"android:focusable="true"android:focusableInTouchMode="true"android:text="你整天说着日了狗日了狗,但是你却没有来,呵呵呵呵呵呵呵呵呵呵~"/>
设置TextView字间距和行间距
字间距:
android:textScaleX:控制字体水平方向的缩放,默认值1.0f,值是floatJava中setScaleX(2.0f);
行间距:
android:lineSpacingExtra:设置行间距,如"3dp" android:lineSpacingMultiplier:设置行间距的倍数,如"1.2"
Java代码中可以通过: setLineSpacing方法来设置
自动换行
自动换行通过 android:singleLine 设置,默认为 false。如需要自动换行,可以用:android:singleLine = "false"如果要在一行显示完,不换行,可以用:android:singleLine = "true"多行显示不完,使用maxLines属性
阅读全文
0 0
- android TextView(5)-TextView一些其他常用效果
- Android TextView滚动效果
- TextView 滚动效果 android
- 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走马灯效果
- TextView控件的一些效果
- U3D -- 关于帧同步的一些文章
- CentOS 7安装部署redis
- Ted:时间管理(提炼)【有用】
- Second Highest Salary
- <开发总结>苹果ios 系统,使用自带浏览器safari,输入正确图形验证码一直报错!
- android TextView(5)-TextView一些其他常用效果
- Kotlin入门语法
- USB知识
- HR吐槽:我们都是被这些熊孩子的简历给气疯的!
- rownum between连用为什么得不到数据呢?
- Ueditor富文本编辑器报错解决方案
- std::sort排序算法
- Android中发送有序广播案例
- SQL 语法大全