TextView 常用摘要
1、代码中设置drawableTop
TextView textView = new TextView(getActivity());
Drawable drawable = getResources().getDrawable(R.drawable.home_1);
drawable.setBounds(0, 0, drawable.getMinimumWidth(),drawable.getMinimumHeight());
textView.setCompoundDrawables(null, drawable, null, null);
textView.setCompoundDrawablePadding(10);//设置drawablepadding
2、走马灯效果
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#ffffff"
android:clickable="true"
android:ellipsize="marquee"
android:focusable="true"
android:focusableInTouchMode="true"
android:freezesText="true"
android:marqueeRepeatLimit="marquee_forever"
android:padding="10dip"
android:selectAllOnFocus="true"
android:singleLine="true"
android:text="123456789987565165465454"
android:textColor="#000000"
android:textSize="22sp" >
</TextView >
3、划线
//上划线
setText(Html.fromHtml("<o>"+要输入的东西+"</o>"));
//下划线
1、setText(Html.fromHtml("<u>"+要输入的东西+"</u>"));
2、tvTest.getPaint().setFlags(Paint. UNDERLINE_TEXT_FLAG ); //下划线
tvTest.getPaint().setAntiAlias(true);//抗锯齿
//中划线
textview.getPaint().setFlags(Paint. STRIKE_THRU_TEXT_FLAG);
4、中文字体加粗
TextView tv = (TextView)findViewById(R.id.tv);
TextPaint tp = tv.getPaint();
tp.setFakeBoldText(true);
TextView 常用摘要的更多相关文章
- Android TextView 常用技巧
Android ListView 常用技巧 Android TextView 常用技巧 TextView在Android中实现文字说明等功能,基本的使用都很简单,那么除了基本展示文字的使用,我们还能够 ...
- Android TextView常用属性
[说明] TextView是用来显示文本的组件.以下介绍的是XML代码中的属性,在java代码中同样可通过 "组件名.setXXX()方法设置.如,tv.setTextColor(); [属 ...
- Android Bitmap Drawable 常用摘要
1.缩放 public Bitmap scalingBitmap(Bitmap bitmap, int newW, int newH) { int w = bitmap.getWidth(); int ...
- OS调度算法常用摘要
一.常见的批处理作业调度 1.先来先服务调度算法(FCFS):就是依照各个作业进入系统的自然次序来调度作业.这样的调度算法的长处是实现简单,公平. 其缺点是没有考虑到系统中各种资源的综合使用情况,往往 ...
- android内部培训视频_第三节 常用控件(Button,TextView,EditText,AutocompleteTextView)
第三节:常用控件 一.Button 需要掌握的属性: 1.可切换的背景 2.9.png使用 3.按钮点击事件 1) onClick 3) 匿名类 4) 公共类 二.TextView 常用属性 1.a ...
- TextView使用大全
最近打算写一个系列的android初级开发教程,预计40篇以上的文章,结合我实际工作中的经验,写一些工作中经常用到的技术,让初学者可以少走弯路,写一个系列的话,大家学习起来也有头有尾. 今天就从我们每 ...
- Android ListView 常用技巧
Android ListView 常用技巧 Android TextView 常用技巧 1.使用ViewHolder提高效率 ViewHolder模式充分利用了ListView的视图缓存机制,避免了每 ...
- android之TextView
TextView 常用属性说明: lines:设置可以显示的文本行数,且不管文本是否足够占用这些行的空间,该组件都会占用这些行的空间高度. maxLines:设置最大显示的行数,随文本改变,占用的行数 ...
- Android控件——TextView,EditText
TextView: 显示文本控件 EditText 输入文本框 1.TextView常用属性:
随机推荐
- socket了解(转)
http://blog.chinaunix.net/uid-26000296-id-3758651.html http://blog.csdn.net/mengyafei43/article/deta ...
- 了解真实的『REM』手机屏幕适配
rem 作为一个低调的长度单位,由于手机端网页的兴起,在屏幕适配中得到重用.使用 rem 前端开发者可以很方便的在各种屏幕尺寸下,通过等比缩放的方式达到设计图要求的效果. rem 的官方定义『The ...
- JAVA语法02之课程问题解决
(一)示例程序+运行结果: ①EnumTest.java public class EnumTest { public static void main(String[] args) { Size s ...
- find / -type f -name "*fetion*" |xargs rm -rf {}\
find / -type f -name "*fetion*" |xargs rm -rf {}\
- VHDL的参数写在一个vhd文件里
1 参数文件top_pkg.vhd
- angular路由
ngRoute需要引进以下文件 <script src="http://code.angularjs.org/1.2.5/angular.min.js"></sc ...
- 后台接收前台传入的json 数据
引入JSONArray的类型为org.json而不是net.sf.json,笔者开始引入的是net.sf.json.JSONArray, 但JSONObject.fromObject(obj)时报错报 ...
- CSS设置DIV背景色渐变
div{ width: 200px; height: 200px; FILTER: progid:DXImageTransform.Microsoft.Gradient(gradientType=, ...
- ArcGIS操作Excel文件没有注册类解决办法
在ArcGIS Desktop中进行表连接时选择了一张excel表,但添加该表时报错: 原因是机器上缺少Office的数据驱动. ArcGIS 支持 : Excel 2003 以及更早版本的 .xls ...
- mysql 存储 emoji报错( Incorrect string value: '\xF0\x9F\x98\x84\xF0\x9F)的解决方案
1.报错原因: mysql utf-8 编码储存的是 2-3个的字节,而emoji则是4个字节. 2.解决办法: 修改mysql的配置文件,windows下的为my.ini(linux下的为my.cn ...