Android常用控件
2017-06-03 23:59
274 查看
一.Textview(显示文本的控件)
android :text 设置文本框内文本内容
android :autoLink 是否将符合指定格式的文本转换为可单击的超链接形式
取值范围:none | web | email | phone | map | all
android:singleLine 为true文本框不会换行
android : lines 默认占几行
android : minLines 最少占几行
android : textColor 字体颜色
android : textSize 字体大小
android : testStyle 字体风格如粗体斜体等
android :backgrount 设置背景
如下代码
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:autoLink="all"
android:textStyle="bold|italic"
android:textSize="30sp"
android:typeface="sans"
android:singleLine="true"
android:ellipsize="marquee"
android:focusable="true"
android:focusableInTouchMode="true"
android:clickable="true"
android:id="@+id/tv_main_text"
android:drawableLeft="@drawable/icon_user"
android:text="我的电话:18692238124。邮箱:352343589@qq.com。百度一下:http://www.baidu.com" />
EditText(编辑文本的控件)
android :password 密码框
android :textColorHighight 文本被选中时的背景颜色
代码演示如下:
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="请输入密码"
android:inputType="number"
android:background="@drawable/et_selector"
/>
外形资源(Shappe)
android :radius 设置四个角的幅度
abdroid : xxxradius 设置某一个角的幅度
代码如下:
<!--弧度-->
<corners
android:topLeftRadius="50dp"
android:bottomRightRadius="50dp"
></corners>
<stroke/>定义几何形状的边框
android :width 边框的宽度
android : color 边框的颜色
android : dashWidth 虚线的宽度
android : dashGap 虚线的间距
<color name=""></color>
selector 选择器
android:state_focused=""
d
danroid :drawable =""
android :text 设置文本框内文本内容
android :autoLink 是否将符合指定格式的文本转换为可单击的超链接形式
取值范围:none | web | email | phone | map | all
android:singleLine 为true文本框不会换行
android : lines 默认占几行
android : minLines 最少占几行
android : textColor 字体颜色
android : textSize 字体大小
android : testStyle 字体风格如粗体斜体等
android :backgrount 设置背景
如下代码
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:autoLink="all"
android:textStyle="bold|italic"
android:textSize="30sp"
android:typeface="sans"
android:singleLine="true"
android:ellipsize="marquee"
android:focusable="true"
android:focusableInTouchMode="true"
android:clickable="true"
android:id="@+id/tv_main_text"
android:drawableLeft="@drawable/icon_user"
android:text="我的电话:18692238124。邮箱:352343589@qq.com。百度一下:http://www.baidu.com" />
EditText(编辑文本的控件)
android :password 密码框
android :textColorHighight 文本被选中时的背景颜色
代码演示如下:
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="请输入密码"
android:inputType="number"
android:background="@drawable/et_selector"
/>
外形资源(Shappe)
android :radius 设置四个角的幅度
abdroid : xxxradius 设置某一个角的幅度
代码如下:
<!--弧度-->
<corners
android:topLeftRadius="50dp"
android:bottomRightRadius="50dp"
></corners>
<stroke/>定义几何形状的边框
android :width 边框的宽度
android : color 边框的颜色
android : dashWidth 虚线的宽度
android : dashGap 虚线的间距
<color name=""></color>
selector 选择器
android:state_focused=""
d
danroid :drawable =""
相关文章推荐
- androidUI第六部分---其他常用控件举例
- Android学习第三天:页面布局和常用控件
- android的常用控件总结【安卓入门五】
- Android常用布局控件之RelativeLayout
- android常用控件四 GridView
- Android常用控件的信息!
- android 事件 和 常用控件
- Android常用控件-AutoCompleteTextView
- Android常用控件-spinner
- android常用控件(转)
- Android常用控件的基本使用说明
- Android基础(四) 常用控件
- Android学习笔记--Android开发时常用控件(三)
- Android常用控件-DatePicker以及对话框的两种使用方法
- android常用控件(三)- ProgressBar、ListView
- Android学习第二天:Intent传输数据、常用控件和Activity生命周期
- Android开发笔记--Android开发时常用控件(二)
- Android基础(四) 常用控件 - ProgressBar
- android常用控件二 gallery
- Android的一段常用动画效果代码(如何让点击的图片控件加速飞入到指定位置)