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. ...
随机推荐
- codeforces 707D-(DFS+bitset)
题目链接:http://codeforces.com/contest/707/problem/D 根据询问建立一棵树然后DFS. #include<bits/stdc++.h> using ...
- 著名的安装制作软件InnoSetup的源码及示例源码-The installation of a well-known software s source code and sample InnoSetup source
@echo off rem Inno Setup rem Copyright (C) 1997-2007 Jordan Russell rem Portions by Martijn Laan rem ...
- 'dict' object has no attribute 'a'
a = {} #a.a = 'a' #AttributeError: 'dict' object has no attribute 'a' #a['a'] #KeyError: 'a' a['a'] ...
- php 在客户端生成txt文件并且下载
在访问php时生成txt文件 $filename = 'file.text'; //也可以是其他后缀格式的 $ua = $_SERVER["HTTP_USER_AGENT"]; f ...
- PAT (Basic Level) Practise:1029. 旧键盘
[题目链接] 旧键盘上坏了几个键,于是在敲一段文字的时候,对应的字符就不会出现.现在给出应该输入的一段文字.以及实际被输入的文字,请你列出肯定坏掉的那些键. 输入格式: 输入在2行中分别给出应该输入的 ...
- C++ list<list<int> >类型的对象遍历
void listSort(list<list<int> >* initList) { list<list<int> >::iterator itera ...
- CMOS、BIOS
CMOS主要的功能为记录主板上面的主要参数,包括系统时间.CPU电压与频率.各项设备的I/O地址与IRQ等,由于这些数据的记录要花费电力,因此主板上面才有电池. BIOS为写入到主板上某一块闪存或EE ...
- TreodeDB测试及总结
参考资料:http://treode.github.io/store/ 官方网站 实际测试环境:3台有公网IP的服务器,一台阿里云,另两台公司内部 1host IP地址 IP1java -jar se ...
- 一个好用的Log管理类
public class L { private static String className; //所在的类名 private static String methodName; //所在的方法名 ...
- Jlink V7在MDK下使用Cortex-M3-Jlink模式开发STM32的说明
Jlink V7在MDK下使用Cortex-M3-Jlink模式开发STM32的说明 开发环境:STM32F103RB(128K Flash 20K RAM)+MDK3.50+JLINK V7(v ...