简单的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分辨率的界面布局及 ...
随机推荐
- Struts简单入门实例
转自http://www.cnblogs.com/xing901022/p/3961661.html 有改动 struts2其实就是为我们封装了servlet,简化了jsp跳转的复杂操作,并且提供了易 ...
- rest framework 权限
一.权限示例 需求:不同的用户类型有不同的权限 普通用户:只能查看个人信息相关,序号:1 VIP 用户:只能查看个人信息相关,序号:2 SVIP 用户:查看订单相关信息,序号:3 1.新建 app/u ...
- 数据绑定—Source(绑定到静态类的静态属性)
<UserControl x:Class="绑定.绑定Source" xmlns="http://schemas.microsoft.com/winfx/2006/ ...
- linux的防火墙端口配置
健忘啊,记下来吧 Red Hat Linux系统 此类型系统包括red hat的各类衍生及相关不版本,包括RHEL.CentOS.Fedora等等. 防火墙配置文件: /etc/sysconfig/i ...
- jsp内置对象request使用方法2
<%@page import="java.text.SimpleDateFormat"%> <%@page import="java.util.Date ...
- thinkphp5.1跨模块调用控制器或者模型
tp5.1 采用命名空间的方式进行调用.
- thinkphp5.1 使用第三方扩展类库
此案例介绍的不是通过composer加载的,是手工下载放入extend目录下的扩展类库,仍然以phpspider为例 将owner888目录放入extend目录下,也可以直接将phpspider目录放 ...
- JMeter - 实时结果 - InfluxDB和Grafana - 第1部分 - 基本设置
概述: 在本文中,我将解释如何使用JMeter + InfluxDB + Grafana获得实时性能测试结果. 请注意,此主题太大,无法涵盖一篇文章中的所有内容.所以,我试图提供与TestAutoma ...
- jmeter如何设置全局变量以及调用方法
当遇到如跨线程组调用变量等情况,需要设置全局变量. 1.打开函数助手 输入需要的值然后点击生成按钮,或者直接使用${__setProperty(newuserid,${userid},)}的格式 设置 ...
- 关于node中的global,箭头函数的this的一个小问题
this一直是一个JS中的困扰问题,这次在跑JS精粹的代码的时候顺带发现了Node里面全局变量的问题 var x = 1; var myObj = { x: 2 }; myObj.func = fun ...