1. TextView——显示文本框控件

    TextView控件的常用属性

    • android:id——控件的id
    • android:layout_width——控件的宽度
    • android:layout_hight——控件的高度
    • android:text——文本内容
    • android:textSize——文本大小
    • android:textColor—文本颜色
    • android:backgound——控件背景

    wrap_content:包裹实际文本内容
    match_parent:当前控件铺满父类容器:2.3api之后添加的一个属性值
    fill_parent:当前控件铺满父类容器:在2.3api之前的一个属性值

2.EditText——输入文本框

  TextView控件的常用属性
  • android:id——控件的id
  • android:layout_width——控件的宽度
  • android:layout_hight——控件的高度
  • android:text——文本内容
  • android:textSize——文本大小
  • android:textColor—文本颜色
  • android:backgound——控件背景
  • android:hint——提示输入文本
  • android:inputType—文本类型

3.ImageView——显示图片的控件

ImageView属性
  • android:src=”@drawable/ic_launcher”——ImageView的图片内容
  • android:background=”@drawable/ic_launcher”——ImageView背景图片
  • android:background=”#00ff00”——ImageView的RGB颜色

4.Button——按钮

特征:

  • 可以作为一个按钮产生明显的点击事件
  • Button有text属性,无src属性,text当中的字符串一般是存放在value当中的string资源
  • 产生明显的点击效果
  • 和smallButton一样,只不过smallButton多一条style属性, style=”?android:attr/buttonStyleSmall”,它调用了系统下面的一个风格

5.ImageButton——图片按钮

<ImageButton android:id="@+id/imagebutton1" android:layout_width="match_parent" android:layout_height="wrap_content" android:src="@drawablebc_ab_share_pack_holo_light" />

特征:

  • 可以作为一个按钮产生明显的点击事件
  • ImageButton有src属性,无text属性,不可以设置文本内容,background以及src添加一个image,当前图片上可以做一个有文本内容的图片
  • 产生明显的点击效果

更多相关文章

  1. 相对布局相关属性
  2. Android(安卓)资源文件中@、@android:type、@*、?、@+含义和区别
  3. TextView跑马灯效果
  4. Android(安卓)资源文件中@、@android:type、@*、?、@+含义和区别
  5. Android(安卓)各种布局 控件内部属性大全|我是记不住了搞下来看
  6. Android(安卓)相对布局属性全集
  7. Android(安卓)TextView跑马灯效果
  8. android中星级评分控件RatingBar的使用
  9. 欢迎进入郭士超的博客目录(全站式导航)

随机推荐

  1. 完美解决 Failed to fetch URL https://d
  2. Android如何设置两个view的Z order?
  3. 通过signapk.jar 为Android(安卓)应用程
  4. Android(安卓)Sensor分析
  5. Android(安卓)TextView 设置字与字之间的
  6. 借助HorizontalScrollView实现多列ListVi
  7. Android(安卓)系统名字、版本、API level
  8. Android(安卓)SwipeRefreshLayout Recycl
  9. 应用内存限制
  10. android生命周期总结