简单的RelativeLayout布局
简单的RelativeLayout布局实例

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
> <TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="20dp"
android:text="Please input the username and password to log on."
android:textSize="14sp"
android:textAppearance="?android:attr/textAppearanceMedium"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginBottom="20dp"
/>
<TextView
android:id="@+id/text_username"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/textView1"
android:layout_alignLeft="@id/textView1"
android:layout_marginRight="20dp"
android:text="User Name:"
android:textSize="20sp"
android:layout_marginBottom="20dp"
/> <EditText
android:id="@+id/edit_username"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignBaseline="@id/text_username"
android:layout_toRightOf="@id/text_username"
android:layout_alignRight="@id/textView1"
android:layout_below="@id/textView1"
/> <TextView
android:id="@+id/text_psw"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/text_username"
android:layout_alignLeft="@id/text_username"
android:layout_marginRight="20dp"
android:text="Password"
android:textSize="20sp"
/> <EditText
android:id="@+id/edit_psw"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@id/text_psw"
android:layout_alignLeft="@id/edit_username"
android:layout_alignRight="@id/edit_username"
android:layout_below="@id/edit_username"
android:inputType="textPassword" /> <Button
android:id="@+id/btn_logon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignRight="@id/edit_psw"
android:text="Log in"
android:textSize="21sp"
android:layout_below="@id/edit_psw"
android:layout_marginTop="20dp"
android:layout_marginLeft="20dp"
/> <Button
android:id="@+id/btn_signin"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/btn_logon"
android:layout_toLeftOf="@+id/btn_logon"
android:text="Sign in"
android:textSize="21sp" /> </RelativeLayout>
简单的RelativeLayout布局的更多相关文章
- Xamarin.Android之简单的抽屉布局
0x01 前言 相信对于用过Android版QQ的,应该都不会陌生它那个向右滑动的菜单(虽说我用的是Lumia) 今天就用Xamarin.Android实现个比较简单的抽屉布局.下面直接进正题. 0x ...
- RelativeLayout布局下实现控件平分空间
起源:使用惯LinearLayout的朋友都知道,若想实现对屏幕的等分,只需要设置Layout_weight的值即可. 可是在RelativeLayout布局下实现等分却不是那么容易. 下面就简单介绍 ...
- 个人经验 - Android的RelativeLayout布局的layout_height属性设置为wrap_content时的坑
Android的RelativeLayout布局的layout_height属性设置为wrap_content时的坑: 此坑出现的条件: 1.RelativeLayout布局的layout_heigh ...
- android:layout_alignleft layout_toleftof区别,详解RelativeLayout布局属性
转载请注明博客地址. 最近看博客看到有关于RelativeLayout布局的解释,有的解释很多是错误的.因此有必要对每一个常见的布局属性进行描述.以下解释全部都是逐行进行测试的. 首先把常用的布局分组 ...
- CSS里总算是有了一种简单的垂直居中布局的方法了
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <m ...
- RelativeLayout布局属性
Android RelativeLayout属性 // 相对于给定ID控件 android:layout_above 将该控件的底部置于给定ID的控件之上; android:layout_below ...
- 用RelativeLayout布局可以在imageview中写上文字
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android=&quo ...
- include设置属性在relativelayout布局中无效
转自:http://4265337.blog.163.com/blog/static/195375820127935731114/ 再来说一个在使用这两个标签时最容易出现的问题. 经常会有同学在Rel ...
- twrp 2.7.0 ui.xml简单分析,布局讲解,第一章
twrp 的ui.xml文件在bootable/recovery/gui/devices/$(DEVICE_RESOLUTION)/res目录里面 下面我主要分析的是720x1280分辨率的界面布局及 ...
随机推荐
- range分表
按主键范围进行分表,假设当前主键的最大值为5000,把数据拆成5等份 1-1000:是5000的第1个范围,把该范围的数据作为一张表 1001-2000:是5000的第2个范围,把该范围的数据作为一张 ...
- 10、scala模式匹配
一.模式匹配1 1.介绍 模式匹配是Scala中非常有特色,非常强大的一种功能.模式匹配,其实类似于Java中的swich case语法,即对一个值进行条件判断,然后针对不同的条件, 进行不同的处理. ...
- iOS开发,使用CocoaSSDP查找设备时按关键字过滤Device
关于CocoaSSDP的资料有很多,这里就不介绍了. 希望寻找的目标设备,在header中设置了自定义的keyword,虽然通过外围代码也能达到相同目的,但是直接修改CocoaSSDP源码更简便. 导 ...
- java多线程有几种实现方法,都是什么?
转自:http://www.cnblogs.com/liujichang/p/3150387.html 多线程有两种实现方法,分别是继承Thread类与实现Runnable接口 同步的实现方法有两种, ...
- HTMLParser使用详解(2)- Node内容
HTMLParser使用详解(2)- Node内容 2010-03-18 13:41 HTMLParser将解析过的信息留存为一个树的结构.Node是信息留存的数据类型基础.请看Node的界说:pu ...
- HDU 3400 Line belt (三分嵌套)
题目链接 Line belt Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)To ...
- Note: Eleos: ExitLess OS Services for SGX Enclaves
Eleos increased I/O and memory intensive SGX program execution performance with In-enclave system ca ...
- .NET Core 3.0 可回收程序集加载上下文
一.前世今生 .NET诞生以来,程序集的动态加载和卸载都是一个Hack的技术,之前的NetFx都是使用AppDomain的方式去加载程序集,然而AppDomain并没有提供直接卸载一个程序集的API, ...
- [CentOS7] 搭建vncserver,远程通过vncviewer来查看图形界面
Linux上搭建vncserver需下载tigervnc,当然可以从命令下载: 查看一下可以下载哪些: 下载tigervnc-server: 然后可以简单看下 cat /lib/systemd/sys ...
- Java面向对象的三大特性 多态
多态 对象的多种形态 继承是实现多态的基础 1,引用多态 父类的引用可以指向本类的对象 父类的引用可以指向子类的对象 2,方法多态 创建本类对象时,调用的方法为本类方法 创建子 ...