(一)三个基本控件
1、标签控件(TextView)
类层次继承图
常用属性
属性 含义
text 文本内容
textSize 文本字号,单位:sp
textColor 文本颜色,#ff0000 - 红色
layout_height 高度,单位:dp (wrap_content, match_parent)
layout_weight 宽度,单位:dp (wrap_content, match_parent)
2、编辑框控件(EditText)
类层次继承图
常用属性
属性 含义
text 文本内容
textSize 文本字号,单位:sp
textColor 文本颜色,#ff0000 - 红色
hint 提示信息
singleLine 单行(true or false)
layout_height 高度,单位:dp (wrap_content, match_parent)
layout_weight 宽度,单位:dp (wrap_content, match_parent)
inputType 输入类型(普通文本、密码、邮件……)
3、按钮控件(Button)
类层次继承图
1、创建安卓应用
- 基于
Empty Activity
模板创建安卓应用