Android: 在 TextView 里使用删除线
- textview.getPaint().setFlags(Paint.STRIKE_THRU_TEXT_FLAG);
顺便研究下:
TextView.getPaint() :
- // Returns the base paint used for the text.
- // Please use this only to consult the Paint's properties and not to change them.
- public TextPaint getPaint();
TextPaint:
- // TextPaint is an extension of Paint that leaves room
- // for some extra data used during text measuring and drawing.
- public class TextPaint extends Paint {...}
Paint:
- // The Paint class holds the style and color information
- // about how to draw geometries, text and bitmaps.
- public class Paint extends Object {...}
Paint.setFlags():
- // Set the paint's flags. Use the Flag enum to specific flag values.
- // flags: The new flag bits for the paint
- public void setFlags (int flags);
Paint.STRIKE_THRU_TEXT_FLAG:
- // Paint flag that applies a strike-through decoration to drawn text.
- // Constant Value: 16 (0x00000010)
- public static final int STRIKE_THRU_TEXT_FLAG;
参考资料:
- TextView | Android Developers http://developer.android.com/reference/android/widget/TextView.html
- TextPaint | Android Developers http://developer.android.com/reference/android/text/TextPaint.html
- Paint | Android Developers http://developer.android.com/reference/android/graphics/Paint.html
http://blog.csdn.net/lilin_emcc/article/details/39549541
Android: 在 TextView 里使用删除线的更多相关文章
- Android在一个TextView里显示不同样式的字体
在同一个TextView里显示不同样式的字体 public void setSpan(Object what, int start, int end, int flags); 样式1:背景色.粗体.字 ...
- Android TextView里显示两种颜色
今天介绍一个小技巧,在Android的TextView里设置两种颜色,直接上代码: TextView TV = (TextView)findViewById(R.id.mytextview01); S ...
- Android中TextView添加删除线
项目中的需求~~~~ 商城中物品的一个本身价格,还有一个就是优惠价格...需要用到一个删除线. public class TestActivity extends Activity { private ...
- 【转】Android TextView SpannableStringBuilder 图文混排颜色斜体粗体下划线删除线
spannableStringBuilder 用法详解: SpannableString ss = new SpannableString("红色打电话斜体删除线绿色下划线图片:." ...
- Android之TextView的样式类Span的使用详解
Android中的TextView是个显示文字的的UI类,在现实中的需求中,文字有各式各样的样式,TextView本身没有属性去设置实现,我们可以通过Android提供的 Spannab ...
- 【Android】 TextView设置个别字体样式
SpannableString msp = new SpannableString("测试"+XM+"更换当前号码将从手机发送一条普通短信进行验证"); msp ...
- TextView里的文 html
一.[Android实例]实现TextView里的文字有不同颜色 转eoe:http://www.eoeandroid.com/thread-4496-1-1.html import android. ...
- [Android教程]TextView使用SpannableString设置复合文本
TextView通常用来显示普通文本,但是有时候需要对其中某些文本进行样式.事件方面的设置.Android系统通过SpannableString类来对指定文本进行相关处理,具体有以下功能: 1.Bac ...
- Android的TextView使用Html来处理图片显示、字体样式、超链接等
一.[Android实例]实现TextView里的文字有不同颜色 转eoe:http://www.eoeandroid.com/thread-4496-1-1.html import android. ...
随机推荐
- linux命令:mv
1.命令介绍: mv是move的缩写,用来移动文件或重命名文件 2.命令格式: mv [选项] 源文件 目标文件 3.命令参数: -b :若需覆盖文件,则覆盖前先行备份. -f --force:fo ...
- 《JavaScript模式》第1章 简介
@by Ruth92(转载请注明出处) 第1章 简介 模式 模式:是指一个通用问题的解决方案. 设计模式 编码模式 反模式:常见的.引发问题比解决的问题更多的一种方法. JavaScript 基本概念 ...
- isFinite
window.isFinite 如果 number 是有限数字(或可转换为有限数字),那么返回 true.否则,如果 number 是 NaN(非数字),或者是正.负无穷大的数,则返回 false
- css 中input和select混排对齐问题
当INPUT.SELECT及用图片做的button放在一起(并排放一起)时,没法子对齐,一个vertical-align:middle就可搞定.
- 优先队列(Priority Queue)
优先队列(Priority Queue) A priority queue must at least support the following operations: insert_with_pr ...
- python 文件操作,seek, tell, name...
可以设置文件当前位置偏移 fileObject.seek(offset [, whence]) offset 文件的读/写指针位置 whence 可选,默认0,相对于文件开始的位置. 1, 相对于目前 ...
- sql server中NULL导入decimal字段时报错
sql server中NULL导入decimal字段时报错 在导入CSV文件时,如果decimal字段为null值,导致文本文件入库时失败. 错误现象 构造例子 新建一张表,包含decimal字段. ...
- AngularJS的路由、模块、依赖注入
AngularJS的路由在实际应用中更多是由另外封装好的angular-ui-router.js实现的! 为什么不用Ajax而要用前端路由?
- 11. Container With Most Water
Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). ...
- 权限分配界面 纯手工 仅用到bootstrap的架构 以及 c标签
<div class="form-group"> <div class="row"> <label ...