1、图片的添加用ImageView控件:用android:background;方法添加就是改变他的背景,或者;android:src添加图片.
2、滚动条:用ScrollView :android:scrollbars="vertical"(垂直滚动条),一直让它显示的的属性是:android:fadeScrollbars="false";
android:scrollbarThumbVertical设置它的颜色。
注意一点就是:滚动条里面只能有一个子类,意思就是覆盖它的只能用一个布局去填充,
如: <ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbarThumbVertical="@android:color/holo_orange_dark"
android:scrollbars="vertical"
android:fadeScrollbars="false"
android:scrollbarSize="4dp" >

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@android:color/holo_blue_light"
android:orientation="vertical" >
.
.只能在这里面添加各种控件布局,
. 否则会有错误报告:ScrollView can host only one direct chaild
.
.
.
</LinearLayout>
</ScrollView>

3、单选框:用<radiobutton/>来定义,但是这样一旦选择了一个,选另一个就不会的话,显示两个都选中。所以要放在RodioGrop里面;
如:<RodioGrop >
<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="男" />

<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="女" />
</RodioGrop>
打印出来的结果是: O 男 O 女
这样使用才会正常.


4、多选框:用chechBox来定义:
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="抢地主" />

打印出来的结果是 : □ 抢地主

更多相关文章

  1. android之layout布局和ListView中的一些属性介绍
  2. android 控件属性大全
  3. Android常用布局属性
  4. 我的Android进阶之旅------>Android 众多的布局属性详解
  5. 【Android】Android控件之Seekbar拖动条的使用
  6. android linearlayout 把控件view置底部(放在页面最下方)
  7. Android 之 自定义控件用法介绍
  8. android布局属性之margin

随机推荐

  1. Android传感器---Motion Sensor(三)
  2. Android的跨进程通信
  3. Android通过URL/URI来打开我们的应用
  4. 计算经纬度间的距离公里数
  5. Android点划线自定义View
  6. android 验证码实现,详细标注!
  7. android-boostrap
  8. Android(安卓)开发环境搭建中--- “An SD
  9. android手机刷机教程
  10. 去掉安装地图