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. ...
随机推荐
- [Camel Basics]
Define routes: Either using Spring xml or Java DSL. Spring xml: <camelContext> <routeBuilde ...
- Mac快捷键 Xcode快捷键
Mac OSX 快捷键&命令行 一.Mac OSX 快捷键 ctrl+shift 快速放大dock的图标会暂时放大,而 ...
- IOS源码封装成.bundle和.a文件时,使用单例作为出口的写法!任何封装都建议使用这种方法作为出口
头文件 以此作为模板,记录于此 #import <Foundation/Foundation.h>#import <UIKit/UIKit.h>//this can write ...
- Json对象与Json字符串互转
1>jQuery插件支持的转换方式: 复制代码 代码如下: $.parseJSON( jsonstr ); //jQuery.parseJSON(jsonstr),可以将json字符串转换成js ...
- matlab norm的使用
格式:n=norm(A,p)功能:norm函数可计算几种不同类型的矩阵范数,根据p的不同可得到不同的范数 以下是Matlab中help norm 的解释 NORM Matrix or vector n ...
- 快速构建express项目
构建node项目 github地址 https://github.com/haoyongliang/quickly-create-node-project.git 创建最基本的node项目 1.全局安 ...
- 图像金字塔及其在 OpenCV 中的应用范例(上)
前言 图像金字塔是计算机图形学中非常重要的一个概念. 本文将详细介绍这个概念,以及它的实现与应用. 图像金字塔的定义 图像金字塔是一组图像的集合,集合中的所有图像都是通过对某一图像连续降采样得到的一组 ...
- java 代码分析工具——JDepend
最近学习Mybatis的官方文档,看到了[项目文档]一节有很多内容没有见过,做个笔记,理解一下. 百科上的介绍,我竟然都看懂了,那就不找其他地方的资料了. JDepend 一个开放源代码的可以用来评价 ...
- 安装完openfire之后打不开的解决方案
今天在http://www.igniterealtime.org/downloads/index.jsp下载了一个最新openfire for mac版 在系统的偏好设置里面是这样的.那个open A ...
- Centos搭建openvpn+mysql数据库认证
服务器环境说明 1.系统版本 CentOS release 5.10 (Final) 64bits 2.软件版本 openvpn-2.3.6-1.el5 lzo-2.02-2.el5.1 lzo-d ...