android控件基本布局
<?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控件基本布局的更多相关文章
- 探究android控件及布局
		
控件(widget) 1. TextView(该控件的一些需要注意的属性,下同) gravity="center"textSize="24sp"textColo ...
 - Android 控件在布局中按比例放置[转]
		
转自:http://netsky1990.blog.51cto.com/2220666/997452 在Android开发中常用到线性布局LinearLayout对界面进行具体的创建,其中 ...
 - Android 手机卫士--自定义组合控件构件布局结构
		
由于设置中心条目中的布局都很类似,所以可以考虑使用自定义组合控件来简化实现 本文地址:http://www.cnblogs.com/wuyudong/p/5909043.html,转载请注明源地址. ...
 - Android编程 控件与布局
		
控件和布局的继承结构 常用控件 1.TextView <?xml version="1.0" encoding="utf-8"?> <Line ...
 - Android 控件属性介绍
		
1.LinearLayout(线性布局): 可以分为水平线性:android:orientation= " horizontal " 和垂直线性:android:orientati ...
 - Android控件Gridview实现仿支付宝首页,Fragment底部按钮切换和登录圆形头像
		
此案例主要讲的是Android控件Gridview(九宫格)完美实现仿支付宝首页,包含添加和删除功能:Fragment底部按钮切换的效果,包含四个模块,登录页面圆形头像等,一个小项目的初始布局. 效果 ...
 - Android 控件架构及View、ViewGroup的测量
		
附录:示例代码地址 控件在Android开发的过程中是必不可少的,无论是我们在使用系统控件还是自定义的控件.下面我们将讲解一下Android的控件架构,以及如何实现自定义控件. 1.Android控件 ...
 - Android控件属性大全(转)
		
http://blog.csdn.net/pku_android/article/details/7365685 LinearLayout 线性布局 子元素任意: Tab ...
 - UIAutomator定位Android控件的方法
		
UIAutomator各种控件定位的方法. 1. 背景 使用SDK自带的NotePad应用,尝试去获得在NotesList那个Activity里的Menu Options上面的那个Add note菜单 ...
 
随机推荐
- 2019MABU3月班——SAP导入总账科目小笔记
			
1. 在目录中找到“集中” 2.总账科目这里输入代码,公司代码为3000 3. 点“创建” 4. 然后可以填下面这些了 5. 转到“创建/银行/利息” 6. 选字段状态组 7. 保存 8.大功告成.
 - 《一些神奇的JS功效》
			
1: async 异步回调 (ES6) async function test(){ console.log("hello wolrd"); } test().then(funct ...
 - html5 浏览文件
			
var fileInput = document.getElementById('test-image-file'), info = document.getElementById('test-fil ...
 - 【codeforces 438D】The Child and Sequence
			
[原题题面]传送门 [大致题意] 给定一个长度为n的非负整数序列a,你需要支持以下操作: 1:给定l,r,输出a[l]+a[l+1]+…+a[r]. 2:给定l,r,x,将a[l],a[l+1],…, ...
 - Unity 2018.2.8 旧版本安装包和破解软件
			
声明:本文所提供的所有软件均来自于互联网,仅供个人研究和学习使用,请勿用于商业用途,下载后请于24小时内删除,请支持正版! 最近Unity官网下载的旧版本,都无法正常破解.此链接有之前下载的离线安装包 ...
 - C#多线程和线程池
			
1.概念 1.0 线程的和进程的关系以及优缺点 windows系统是一个多线程的操作系统.一个程序至少有一个进程,一个进程至少有一个线程.进程是线程的容器,一个C#客户端程序开始于一个单独的线程,C ...
 - Linux——高效玩转命令行
			
[0]统计文件or压缩文件的行数 zcat file.gz | sed -n '$=' #迅速.直接打印出多少行.-n 取消默认的输出,使用安静(silent)模式 '$=' 不知道是什么 ...
 - Yum安装时出现 The program yum-complete-transaction is found in the yum-utils package
			
yum安装时出现 The program yum-complete-transaction is found in the yum-utils package yum之后,会显示上信息,并且最终执行结 ...
 - roc曲线和auc
			
只是为了复习一下,在评价分类器的性能好坏时,通常用recall和precision, PS:CNN做图像分类还是用了loss 和 accuracy 使用ROC的目的在于更好的(直观+量化)评价分类模型 ...
 - LeetCode--034--在排序数组中查找元素的第一个和最后一个位置(java)
			
给定一个按照升序排列的整数数组 nums,和一个目标值 target.找出给定目标值在数组中的开始位置和结束位置. 你的算法时间复杂度必须是 O(log n) 级别. 如果数组中不存在目标值,返回 [ ...