android的图片添加、滚动条、单选框、多选框、跳转界面
来源:互联网 发布:呼死你软件横行 编辑:程序博客网 时间:2024/05/21 06:37
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="抢地主" />
打印出来的结果是 : □ 抢地主
- android的图片添加、滚动条、单选框、多选框、跳转界面
- android 添加视图的滚动条
- android app小白试水2-添加图片和文字滚动条
- MFc界面添加滚动条笔记
- Android TextView 添加滚动条
- android TextView添加滚动条
- android通过Intent跳转到添加联系人界面的小结
- 图片随滚动条滚动的代码
- android中通过滚动条实现图片的渐变
- android基础:android页面添加滚动条
- Android开发在代码中控制view的显隐时,界面滚动条滚动
- Android开发在代码中控制view的显隐时,界面滚动条滚动
- Android TextView文字过多,添加滚动条
- Android TextView文字过多,添加滚动条
- Android入门:向TextView添加滚动条
- 【android layout】为TextView添加滚动条
- Android TextView文字过多,添加滚动条
- Android TextView文字过多,添加滚动条
- Caused by: java.sql.SQLException: Field 'id' doesn't have a default value
- 理解java中的new
- 重复做,重复做,重复做,重要的事情说三遍
- 【Qt编程】基于Qt的词典开发系列<九>--JSON数据解析
- 基于SDN的SVC视频组播系统搭建一
- android的图片添加、滚动条、单选框、多选框、跳转界面
- awesome窗口管理器启动时自动运行 设定的程序
- 基于mindwave脑电波进行疲劳检测算法的设计(5)
- 查找按某列排序后的第n个值
- 图片 OOM
- java日期各种格式之间的相互转换
- Java-Object的clone方法 protected的相关问题。
- eclipse设置界面主题
- LCD 相关博客