android UI基本控件

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




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值