<?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. MTK(android init.rc) 写一个开机启动的服务

    在开机往往我们想要做一些初始化的操作,这时候可以使用init.rc文件来实现,当然书写一个开机启动的服务也需要规范的. 假设是C程序,则需要准备C程序的源码,在我的例程中是一个在开机完成(androi ...

  2. 多线程threading 的使用

    在Python3中,通过threading模块提供线程的功能.原来的thread模块已废弃.但是threading模块中有个Thread类(大写的T,类名),是模块中最主要的线程类,一定要分清楚了,千 ...

  3. Linux命令-cut篇

    Cut 命令是常用的 Linux 命令,在这里总结一下平时常用的参数和用法,方便查证. 常用参数: -b:以字节为单位进行分割: -c:以字符为单位进行分割: -d:自定义分割符进行分割,默认为制表符 ...

  4. Q语言-[帝王三国送将辅助]

    纯属自己写的, 玩同一个游戏的朋友,需要送将的, 把需要送的将改名为送, 然后启动辅助即可 本辅助只支持1024x576 191dpi 附上源码 //本源码初始化分辨率1024x576[夏天] Dim ...

  5. PL/SQL执行计划查看

    一.如何查看PLSQL的执行计划 在SQl Window窗口输入sql语句,然后按键"F5",就会进入执行计划查看界面. 二.界面说明 首先我们看第二行有几个属性可以选“Tree” ...

  6. sqllite中实现字符串分割

    WITH split(word, str) AS (    -- alternatively put your query here    -- SELECT '', category||',' FR ...

  7. The frequent used operation in Linux system

    The frequently used operation in Linux system    2017-04-08 12:48:09  1. mount the hard disk:  #: fd ...

  8. (转) NAS(神经结构搜索)综述

    NAS(神经结构搜索)综述 文章转载自:http://www.tensorinfinity.com/paper_136.html 本文是对神经结构搜索(NAS)的简单综述,在写作的过程中参考了文献[1 ...

  9. 【python3】 函数 装饰器

    第一步 : 了解装饰器 装饰器模式,重点在于装饰,装饰的核心仍是被装饰的对象. 举一个栗子:我今天穿了一件短袖,但是突然一阵风,短袖没办法为我御寒,我想到的办法是将短袖变得更厚更长,但是改造之后,它就 ...

  10. [CentOS_7.4]Linux编译安装ffmpeg

    [CentOS_7.4]Linux编译安装ffmpeg   安装过程: 下载安装源,配置,编译,安装,设置环境变量. # wget http://www.ffmpeg.org/releases/ffm ...