RadioGroup单选按钮排版
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.example.question_6.MainActivity$PlaceholderFragment" > <TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/textView2"
android:layout_centerHorizontal="true"
android:layout_marginTop="18dp"
android:text="你喜欢车吗?"
android:textAppearance="?android:attr/textAppearanceSmall" /> <CheckBox
android:id="@+id/CheckBox01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:text="名车" /> <TextView
android:id="@+id/TextView01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/CheckBox01"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:gravity="center"
android:text="你更喜欢什么"
android:textAppearance="?android:attr/textAppearanceSmall" /> <CheckBox
android:id="@+id/CheckBox03"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/checkBox3"
android:layout_centerVertical="true"
android:text=" 爱人" /> <CheckBox
android:id="@+id/CheckBox02"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/checkBox2"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:text=" 金钱" /> <Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/CheckBox03"
android:layout_centerHorizontal="true"
android:onClick="setting"
android:text="确定" /> <RadioGroup
android:id="@+id/radioGroup1"
android:layout_width="wrap_content"
android:layout_height="match_parent" >
</RadioGroup> <TextView
android:id="@+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_below="@+id/button1"
android:text="你的基本信息"
android:textAppearance="?android:attr/textAppearanceLarge" /> <TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:gravity="center"
android:text="@string/hello_world" /> <CheckBox
android:id="@+id/checkBox2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/checkBox1"
android:layout_alignBottom="@+id/checkBox1"
android:layout_alignParentRight="true"
android:text="别克君威" /> <CheckBox
android:id="@+id/checkBox1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/TextView01"
android:layout_alignParentLeft="true"
android:layout_marginBottom="22dp"
android:text="宝马" /> <CheckBox
android:id="@+id/checkBox3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/checkBox2"
android:layout_alignBottom="@+id/checkBox2"
android:layout_toLeftOf="@+id/checkBox2"
android:text="阿斯顿马丁" /> <RadioGroup
android:id="@+id/radioGroup2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_below="@+id/textView1"
android:orientation="vertical" > <LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" > <RadioButton
android:id="@+id/radio0"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1.53"
android:checked="true"
android:text="喜欢" /> <RadioButton
android:id="@+id/radio1"
android:layout_width="108dp"
android:layout_height="wrap_content"
android:text="不喜欢" /> </LinearLayout> </RadioGroup> <TextView
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/checkBox2"
android:layout_alignLeft="@+id/checkBox3"
android:text="你想买哪个牌子的车"
android:textAppearance="?android:attr/textAppearanceSmall" /> </RelativeLayout>
再附上一个链接
RadioGroup单选按钮排版的更多相关文章
- Android控件-单选按钮RadioButton
RadioGroup单选按钮用法,还是先看效果图 先中后,点RadioGroup测试按钮,可在标题栏显示选择结果,点清除可以清除选择.下面上代码,main.xml: <RadioGroup an ...
- Android自定义控件1--自定义控件介绍
Android控件基本介绍 Android本身提供了很多控件比如我们常用的有文本控件TextView和EditText:按钮控件Button和ImageButton状态开关按钮ToggleButton ...
- android 属性
RelativeLayout 第一类:属性值为true可false android:layout_centerHrizontal 水平居中 android:layout_centerVe ...
- Android 自定义RadioButton实现
由于使用小米系统MIUI运行是RadioButton样式跟google Android API自定义的不一样,则我们可以定义任何想要的东东.没有做不到,只有想不到 Android 自定义RadioBu ...
- Android开发 ---xml布局元素
1.android:orientation="vertical/horizontal" vertical为垂直布局, horizontal为水平布局 2.android:layou ...
- Android------------UI的控件学习内容
1. android:gravity="fill_horizontal" : 文本在显示框中内容显示的位置 2.ToggleButton : 切换按钮 3.RadioGrou ...
- Android layout 布局 属性详解
第一类:属性值 true或者 false android:layout_centerHrizontal 水平居中 android:layout_centerVertical ...
- Android layout布局属性、标签属性总结大全
RelativeLayout 第一类:属性值为true可false android:layout_centerHrizontal 水平居中 android:layout_centerVe ...
- Android控件介绍
1. 介绍 Android控件大多位于android.widget, android.view.View为他们的父类对于Dialog系列, android.app.Dialog为父类 Android的 ...
随机推荐
- jQuery中事件的学习
刚学习了jQuery中的事件,主要通过bind(),toggle(),hover()来主要实现,下面先说一说关于bind的想关要点. 1.bind方法. bind方法的主要参数为bind(type,f ...
- highCharts 图表统计控件使用方法
1.首先引用js文件 在引用上面文件时,保证已经引用了jquery.js文件.且位置在上面两个文件之前. 2. <div id="container" style=" ...
- js 遇到 Permission denied to access property ***
在开发过程 子页面刷新父页面时,中遇到的 Permission denied to access property *** 问题,处理如下: 这是一个跨域的问题,其实很简单 就是子页面所在域名不在父页 ...
- xml中的特殊符号
其实就是xml的特殊符号,因为它的配置就是xml,所以可以用下面这种写法转义 < < > > <> < ...
- Asp.net mvc中Controller的返回值
(1)EmptyResult:当用户有误操作或者是图片防盗链的时候,这个EmptyResult就可以派上用场,返回它可以让用户啥也看不到内容,通过访问浏览器端的源代码,发现是一个空内容: public ...
- connect函数
TCP客户用connect函数来建立与TCP服务器的连接 int connect (int sockfd, const sockaddr * servaddr, socklen_t addrlen); ...
- codevs 1153 道路游戏
传送门 题目描述 Description 小新正在玩一个简单的电脑游戏.游戏中有一条环形马路,马路上有n 个机器人工厂,两个相邻机器人工厂之间由一小段马路连接.小新以某个机器人工厂为起点,按顺时针 ...
- android 休眠唤醒机制分析(二) — early_suspend
本文转自:http://blog.csdn.net/g_salamander/article/details/7982170 early_suspend是Android休眠流程的第一阶段即浅度休眠,不 ...
- Redis系列(2)之数据类型
Redis系列(2)之数据类型 <Redis系列(1)之安装>中介绍了Redis支持以下几种数据类型,那么本节主要介绍学习下这几种数据类型的基本操作 字符串类型,string 散列类型,h ...
- Android HttpClient POST JSON Restful-web-services
@Override protected String doInBackground(String... arg0) { Gson gson = new Gson(); String json = gs ...