6 Android UI组件使用

6 Android UI组件使用
1. 文本视图:TextView
<TextView
//指定ID
  android:id=”@+id/tv_test1_message”
//宽度
  android:layout_width=”match_parent”
//高度
  android:layout_height=”match_parent”
//文本
  android:text=”   ”
//文本颜色
  android:textcolor=”  “
//文本大小
  android:textsize=”  “
2. 文本输入框:EditText
<EditText
 //默认提示文本
  android:hint=”  “
//输入数据类型限定
   android:inputTape=”   “
3. 按钮:button
<Button
 //宽度
  android:layout_width=”match_parent”
//高度
  android:layout_height=”match_parent”
//按钮文本
  android:text=”   ”
//按钮文本大小
  android:textsize=”  “
4. 图片视图:ImageView
<ImageView
//背景图片
   android:background=”   “
//前景图片
android:src=”   “
5. 多选框:CheckBox
<CheckBox
//标识默认是否勾选
  android:checked=”true”
6. 单选框:RadioGroup/RadioButton
<RadioGroup
  //指定ID
  android:id=”@+id/rg_test1_sex”
//宽度
  android:layout_width=”fill_parent”
//高度
  android:layout_height=”fill_parent”
  android:orientation=”horizontal”
<RadioButton
//设置某个状态被选中
  android:checked=”true”
7. 文本小提示:Toast

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值