简单的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布局的更多相关文章

  1. Xamarin.Android之简单的抽屉布局

    0x01 前言 相信对于用过Android版QQ的,应该都不会陌生它那个向右滑动的菜单(虽说我用的是Lumia) 今天就用Xamarin.Android实现个比较简单的抽屉布局.下面直接进正题. 0x ...

  2. RelativeLayout布局下实现控件平分空间

    起源:使用惯LinearLayout的朋友都知道,若想实现对屏幕的等分,只需要设置Layout_weight的值即可. 可是在RelativeLayout布局下实现等分却不是那么容易. 下面就简单介绍 ...

  3. 个人经验 - Android的RelativeLayout布局的layout_height属性设置为wrap_content时的坑

    Android的RelativeLayout布局的layout_height属性设置为wrap_content时的坑: 此坑出现的条件: 1.RelativeLayout布局的layout_heigh ...

  4. android:layout_alignleft layout_toleftof区别,详解RelativeLayout布局属性

    转载请注明博客地址. 最近看博客看到有关于RelativeLayout布局的解释,有的解释很多是错误的.因此有必要对每一个常见的布局属性进行描述.以下解释全部都是逐行进行测试的. 首先把常用的布局分组 ...

  5. CSS里总算是有了一种简单的垂直居中布局的方法了

    <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <m ...

  6. RelativeLayout布局属性

    Android RelativeLayout属性 // 相对于给定ID控件 android:layout_above 将该控件的底部置于给定ID的控件之上; android:layout_below ...

  7. 用RelativeLayout布局可以在imageview中写上文字

    <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android=&quo ...

  8. include设置属性在relativelayout布局中无效

    转自:http://4265337.blog.163.com/blog/static/195375820127935731114/ 再来说一个在使用这两个标签时最容易出现的问题. 经常会有同学在Rel ...

  9. twrp 2.7.0 ui.xml简单分析,布局讲解,第一章

    twrp 的ui.xml文件在bootable/recovery/gui/devices/$(DEVICE_RESOLUTION)/res目录里面 下面我主要分析的是720x1280分辨率的界面布局及 ...

随机推荐

  1. JavaScript正则表达式应用---replace()

    replace()方法使用一个替换值(replacement)替换掉一个匹配模式(pattern)在原字符串中某些或所有的匹配项,并返回替换后的字符串.这个替换模式可以是字符串或者RegExp(正则表 ...

  2. Ubuntu12.04更新出现 The system is running in low-graphics mode解决方法

    这两天都困在这个问题上. 感谢:http://blog.chinaunix.net/uid-26748719-id-3780062.html 原因:显卡没驱动起来 解决方法: sudo apt-get ...

  3. c#桌面应用程序--窗体重复创建问题

    重复创建窗体问题的引出 连续单击添加窗体按钮,通过普通的在按钮事件方法中创建窗体,显示窗体的后果是,我们会发现,相同的窗体会重复不断的弹出.代码如下: //添加窗口事件方法 private void ...

  4. 微信H5支付----报undened index openid

    1.检查传过来的订单号是否是恒定不变的 2.检查总价是否为整数(微信要求订单金额是整数).以及不能为0 以下是这次错误的具体原因: 主要是前面读取的金额数据需要读取接口的,而不是数据库的(接口读取的是 ...

  5. GoWeb开发_Iris框架讲解(二):Get、Post、Put等请求及数据返回格式

    数据请求方式的分类 所有的项目中使用的请求都遵循HTTP协议标准,HTTP协议经过了1.0和1.1两个版本的发展. HTTP1.0定义了三种请求方法: GET, POST 和 HEAD方法. HTTP ...

  6. 有关UPDATE操作的一些想法

    我们平常写代码的时候,无疑都会接触大量的数据CURD操作.第一反应是这太简单了,那么你在编写UPDATE操作的时候是怎样的逻辑呢?比较下面两段伪代码: code exp.1 $SQL = " ...

  7. bzoj3171: [Tjoi2013]循环格(费用流)

    传送门 其实这题的建图并不难(虽然我并没有想出来) 首先,每一个点的入度和出度必须为$1$ 那么我们考虑拆点 每个点的出度点向它能到达的点的入度点连边,容量$1$,如果方向为原来的方向则费用$0$否则 ...

  8. Dedecms本地上传缩略图无法自动添加水印的解决方法

    客户遇到一个问题,DEDECMS(V5.7)后台添加文档时,本地上传缩略图无法自动添加水印(系统设置里的图片水印设置没有问题),找了半天,终于找到了解决方法,留个记号: 打开dede/archives ...

  9. Git/Bitbucket Workflow

    中文 http://blog.jobbole.com/76843/ 英文 https://www.atlassian.com/git/tutorials/comparing-workflows#cen ...

  10. sql For update

    for update 的作用和目的:select for update 是为了在查询时,对这条数据进行加锁,避免其他用户以该表进行插入,修改或删除等操作,造成表的不一致性. 几个类似的场景: sele ...