<?xml version="1.0" encoding="utf-8"?>
<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.tw.flag.myhyx.MainHyx"> <TextView
android:layout_width="wrap_content"//设置文本框的宽度
android:layout_height="wrap_content"//设置文本框的高度
android:id="@+id/text"//文本框的ID
android:text="用户名"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/text1"
android:text="密码"
android:layout_below="@+id/text"//设置当前空间在某个位置下面
android:layout_marginTop="10dp"/>指定移动的像素的上偏移值
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/text2"
android:text="确认密码"
android:layout_below="@+id/text1"
android:layout_marginTop="10dp"/>
<EditText
android:id="@+id/edit1"
android:layout_width="200dp"
android:layout_height="40dp"
android:inputType="textPersonName"
android:layout_marginLeft="60dp"
android:layout_marginTop="-18dp"
/>
<EditText
android:id="@+id/edit2"
android:layout_width="200dp"
android:layout_height="40dp"
android:inputType="textPassword"
android:layout_marginLeft="60dp"
android:layout_marginTop="10dp"
/>
<EditText
android:id="@+id/edit3"
android:layout_width="200dp"
android:layout_height="40dp"
android:inputType="textPassword"
android:layout_marginLeft="60dp"
android:layout_marginTop="35dp"
/> <Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="注 册"
android:id="@+id/button"
android:layout_below="@+id/edit3"
android:layout_centerHorizontal="true"//将该空间置于水平居中
android:layout_marginTop="20dp" /> </RelativeLayout>
//实现男、女的单选控件
<?xml version="1.0" encoding="utf-8"?>
<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.tw.flag.mybuju.MainActivity"> <EditText
android:id="@+id/edit_text"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:maxLength="10"
android:hint="单选框按钮测试"
android:textColor="#999999"
android:textColorHint="#999999">
</EditText>
<TextView
android:id="@+id/textview1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="你来自那个城市"
android:layout_below="@id/edit_text"
/>
<RadioGroup
android:id="@+id/radioGroup2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_below="@id/textview1"
>
<RadioButton
android:id="@+id/radioBtn5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="广东"
android:layout_below="@id/textview1"/>
<RadioButton
android:id="@+id/radioBtn6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="广西"
android:layout_below="@+id/radioBtn5"/>
<RadioButton
android:id="@+id/radioBtn7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="湖南"
android:layout_below="@+id/radioBtn6"/>
</RadioGroup> <View
android:id="@+id/View8"
android:layout_width="match_parent"
android:layout_height="1px"
android:background="#999999"
android:layout_below="@+id/radioGroup2"
/>
<RadioGroup

        android:id="@+id/radioGroup3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_below="@id/View8"
>
<RadioButton
android:id="@+id/radioBtn8"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="男"
android:layout_below="@+id/View8"/>
<RadioButton
android:id="@+id/radioBtn9"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="女"
android:layout_below="@+id/radioBtn8"/>
</RadioGroup>
</RelativeLayout>

android控件基本布局的更多相关文章

  1. 探究android控件及布局

    控件(widget) 1. TextView(该控件的一些需要注意的属性,下同) gravity="center"textSize="24sp"textColo ...

  2. Android 控件在布局中按比例放置[转]

    转自:http://netsky1990.blog.51cto.com/2220666/997452       在Android开发中常用到线性布局LinearLayout对界面进行具体的创建,其中 ...

  3. Android 手机卫士--自定义组合控件构件布局结构

    由于设置中心条目中的布局都很类似,所以可以考虑使用自定义组合控件来简化实现 本文地址:http://www.cnblogs.com/wuyudong/p/5909043.html,转载请注明源地址. ...

  4. Android编程 控件与布局

    控件和布局的继承结构 常用控件 1.TextView <?xml version="1.0" encoding="utf-8"?> <Line ...

  5. Android 控件属性介绍

    1.LinearLayout(线性布局): 可以分为水平线性:android:orientation= " horizontal " 和垂直线性:android:orientati ...

  6. Android控件Gridview实现仿支付宝首页,Fragment底部按钮切换和登录圆形头像

    此案例主要讲的是Android控件Gridview(九宫格)完美实现仿支付宝首页,包含添加和删除功能:Fragment底部按钮切换的效果,包含四个模块,登录页面圆形头像等,一个小项目的初始布局. 效果 ...

  7. Android 控件架构及View、ViewGroup的测量

    附录:示例代码地址 控件在Android开发的过程中是必不可少的,无论是我们在使用系统控件还是自定义的控件.下面我们将讲解一下Android的控件架构,以及如何实现自定义控件. 1.Android控件 ...

  8. Android控件属性大全(转)

    http://blog.csdn.net/pku_android/article/details/7365685 LinearLayout         线性布局        子元素任意: Tab ...

  9. UIAutomator定位Android控件的方法

    UIAutomator各种控件定位的方法. 1. 背景 使用SDK自带的NotePad应用,尝试去获得在NotesList那个Activity里的Menu Options上面的那个Add note菜单 ...

随机推荐

  1. Linux服务器 XAMPP后添加PHP和MYSQL环境变量

    编辑/etc/profile文件 在文件末尾添加两行代码 vi /etc/profile CentOS: PATH=$PATH:/opt/lampp/bin export PATH Ubuntu: e ...

  2. vue3.0使用axios报错问题记录

    vue-cli3.0使用axios的时候出现错误,记录一下 报错信息: Uncaught TypeError: Cannot set property $axios of #<Vue> w ...

  3. Unity3D里怎样隐藏物体

    方法很多: 1.改position,移到视野外,推荐,最节省 2.gameObject.SetActive (false); //要提前引用,要不你就改不回来了... 3.renderer.enabl ...

  4. python程序—封装案例

    需求: 1.房子有户型.总面积.家具名称列表 房子没有任何家具 2.家具有名字和占地面积,其中 席梦思(bed):4平米 衣柜(chest): 2平米 餐桌(table): 1.5平米 3.将以上3个 ...

  5. LINQ to Entities does not recognize the method 'System.DateTime AddDays(Double)' method, and this method cannot be translated into a store expression.

    NormalSubmission=analysis.Count(x=>x.FinishTime<= endTime.AddDays(1))报错linq不能识别 => var endT ...

  6. scipy 短时傅里叶变化

    原文链接   https://www.cnblogs.com/hoojjack/p/9967298.html 计算短时傅里叶变换(STFT) scipy.signal.stft(x,fs = 1.0, ...

  7. 解决一次git问题

    由于特殊原因,工作中不能使用sourcetree,今天遇到了一个问题记录一下解决办法,后续还是得好好去廖雪峰大神那里学习一下git的命令行操作呀 You have not concluded your ...

  8. 浅谈现公司的Spring Cloud微服务框架

    目录 说在前面 服务注册与发现 服务网关及熔断 配置中心 消息中心.服务链路追踪 小言 说在前面 本文偏小白,大佬慎入,若有错误或者质疑,欢迎留言提问,谢谢,祝大家新年快乐. spring cloud ...

  9. react项目中实现悬浮(hover)在按钮上时在旁边显示提示

    <i className={classNames({ 'device-icon': true, 'camera-icon': true, 'camera-icon-hover-show-intr ...

  10. SQL Server 第四章 存储过程(Procedure),触发器(Trigger),数据完整性(Data Integrity)

    use electric go --变量 --局部变量的声明格式 --declare @局部变量名 数据类型 --局部变量赋值 declare @littlepage int )) ) select ...