设为首页 加入收藏

TOP

Android字体小结(二)
2014-11-24 12:05:07 来源: 作者: 【 】 浏览:1
Tags:Android 字体 小结
ceMediumInverse/textAppearanceSmall/textAppearanceSmallInverse android:textColor设置文本颜色


android:textColorHighlight 被选中文字的底色,默认为蓝色android:textColorHint设置提示信息文字的颜色,默认为灰色。与hint一起使用。


android:textColorLink文字链接的颜色.android:textScaleX 设置文字之间间隔,默认为1.0f。分别设置0.5f/1.0f/1.5f/2.0f效果如下:


android:textSize 设置文字大小,推荐度量单位”sp”,如”15sp”android:textStyle 设置字形[bold(粗体) 0, italic(斜体) 1, bolditalic(又粗又斜) 2] 可以设置一个或多个,用“|”隔开 android:typeface 设置文本字体,必须是以下常量值之一:normal 0, sans 1, serif 2, monospace(等宽字体) 3] android:height设置文本区域的高度,支持度量单位:px(像素)/dp/sp/in/mm(毫米)


android:maxHeight设置文本区域的最大高度


android:minHeight设置文本区域的最小高度


android:width设置文本区域的宽度,支持度量单位:px(像素)/dp/sp/in/mm(毫米),与layout_width的区别看这里。


android:maxWidth设置文本区域的最大宽度android:minWidth设置文本区域的最小宽度




xml version="1.0" encoding="utf-8"
ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
LinearLayout
android:id="@+id/security_settings_list"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"

TextView


android:orientation="horizontal"


android:layout_width="fill_parent"


android:layout_height="wrap_content"


android:paddingLeft="5sp"


android:typeface="monospace"


android:text="Hello Red Monospace"


android:textSize="16sp"


android:textColor="#ff0000"


/



TextView


android:orientation="horizontal"


android:layout_width="fill_parent"


android:layout_height="wrap_content"


android:text="Sans Font:"


android:textSize="16sp"


android:paddingLeft="5sp"


/


TextView


android:orientation="horizontal"


android:layout_width="fill_parent"


android:layout_height="wrap_content"


android:paddingLeft="5sp"


android:typeface="sans"


android:text="Hello Blue Sans"


android:textSize="16sp"


android:textColor="#0000ff"


/



TextView


android:orientation="horizontal"


android:layout_width="fill_parent"


android:layout_height="wrap_content"


android:text="Serif Font:"


android:textSize="16sp"


android:paddingLeft="5sp"


/


TextView


android:orientation="horizontal"


android:layout_width="fill_parent"


android:layout_height="wrap_content"


android:paddingLeft="5sp"


android:paddingRight="2sp"


android:typeface="serif"


android:text="Hello Green Serif"


android:textSize="16sp"


android:textColor="#00ff00"


/

TextView


android:orientation="horizontal"


android:layout_width="fill_parent"


android:layout_height="wrap_content"


android:paddingLeft="5sp"


android:paddingTop="15sp"


android:typeface="no


首页 上一页 1 2 下一页 尾页 2/2/2
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇简单的计算器编写 基于Android 2.2 下一篇Auto activation triggers for Ja..

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容:

·Libevent C++ 高并发 (2025-12-26 00:49:30)
·C++ dll 设计接口时 (2025-12-26 00:49:28)
·透彻理解 C 语言指针 (2025-12-26 00:22:52)
·C语言指针详解 (经典 (2025-12-26 00:22:49)
·C 指针 | 菜鸟教程 (2025-12-26 00:22:46)