android的图片添加、滚动条、单选框、多选框、跳转界面
1、图片的添加用ImageView控件:用android:background;方法添加就是改变他的背景,或者;android:src添加图片.
2、滚动条:用ScrollView :android:scrollbars="vertical"(垂直滚动条),一直让它显示的的属性是:android:fadeScrollbars="false";
android:scrollbarThumbVertical设置它的颜色。
注意一点就是:滚动条里面只能有一个子类,意思就是覆盖它的只能用一个布局去填充,
如:
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" >
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
.
.
.
3、单选框:用
如:
android:layout_height="wrap_content"
android:text="男" />
android:layout_height="wrap_content"
android:text="女" />
打印出来的结果是: O 男 O 女
这样使用才会正常.
4、多选框:用chechBox来定义:
android:layout_height="wrap_content"
android:text="抢地主" />
打印出来的结果是 : □ 抢地主
更多相关文章
- Android(安卓)RelativeLayout 属性大全
- linearLayout 和 relativeLayout的属性区别
- Android中android:visibility的3中属性的剖析
- 【学习笔记】Android常用布局
- Android(安卓)面试总结之布局常见问题
- Android部分控件的特殊属性
- 相对布局属性
- [摘]android 入门xml布局文件
- 布局(1、线性布局)