Android之TextView效果
2016-05-25 17:53
369 查看
跑马灯效果(文字要足够长):
自动链接(电话.Email.网址都可以支持自动转换成链接):
文本删除线
textView.getPaint().setFlags(Paint.STRIKE_THRU_TEXT_FLAG);
备注:TextView的Text可加载自HTML文件或HTML字符串
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/hello_world" android:singleLine="true" android:ellipsize="marquee" android:marqueeRepeatLimit="marquee_forever" android:focusable="true" android:focusableInTouchMode="true"/>
自动链接(电话.Email.网址都可以支持自动转换成链接):
<TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="center_horizontal" android:autoLink="all" android:text="@string/name"/>
文本删除线
textView.getPaint().setFlags(Paint.STRIKE_THRU_TEXT_FLAG);
备注:TextView的Text可加载自HTML文件或HTML字符串
TextView t3 = (TextView) findViewById(R.id.text3); t3.setText( Html.fromHtml( "<b>text3:</b> Text with a " + "<a href=\"http://www.google.com\">link</a> " + "created in the Java source code using HTML."));
相关文章推荐
- Android根据屏幕宽度,按比例缩放图片(图片)
- (4.6.12.6)Android中<meta-data>的使用
- Android 上传图片到服务器
- 为Android Studio2.1.1增加注释函数
- 【android】:android的工程路径都是啥
- 王学岗自定义控件(一)
- Android GridLayout中元素平分且行充满屏幕(计算器的界面效果)
- OverFlowButton的替换方式
- 【Android】如何获取TextView的控件宽度以及字体宽度
- Android 使用addview生成列表,界面切换时将指定的行数滚动到列表的第一行
- android内存溢出问题
- [置顶] Android自定义ViewGroup(四、打造自己的布局容器)
- Android控件系列之RadioButton&RadioGroup
- Android自定义ViewGroup(四、打造自己的布局容器)
- android蓝牙开发---与蓝牙模块进行通信
- Android技巧之封装Log工具类
- Android 6.0 ConfirmCredential
- Android Studio 2.1.1 更换主题 代码样式
- android 蓝牙编程重点---如何发送和接收16进制数据
- android 基础 线程池 4种创建方式