1、了解以下基本控件
TextView(文本控件)字体大小用sp
EditText(可输入文本文档)
Button(按钮)
RadioButton以及RadioGroup(单选按钮)
单选按钮要注意编写ID,否则不能单选
CheckBox(多选框)
ImageView(图片控件)/2
2、TextView的基本属性
android:text
android : textColor
android : textSize
android :gravity=”center_vertical”文本垂直居中显示
android:android:singleLine="true"设置文本框为单行模式
android:ellipsize="end"文本过长时,末尾省略
3、EditText的基本属性
android:inputType设置文本编辑框的输入类型
android:hint 设置文本编辑框显示的提示文本
android:drawableLeft 在文本框左侧绘制图片
android:drawablePadding 图片与文本的距离
horizontal 水平 vertical 垂直
4、Button的基本属性
Button的点击事件监听
4种监听方式:内部类监听、匿名监听、本类监听、布局监听
总结:
各个控件之间相同的属性
android:text,android:width,android:height
android:id
每个控件独有的属性
Button:onClick
EditText: hint,inputType
CheckBox:Checked
RadioButton:Checked