简单的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分辨率的界面布局及 ...
随机推荐
- 《精通Spring4.X企业应用开发实战》读后感第六章(属性编辑器)
- [转]成为优秀Java程序员的10大技巧
转自:http://www.codeceo.com/article/10-good-java-programmer-tips.html Java程序员有许多应遵循的守则或最佳实践方式.本文概述了每个开 ...
- Boost Python官方样例(三)
导出C++类(纯虚函数和虚函数) 大致做法就是为class写一个warp,通过get_override方法检测虚函数是否被重载了,如果被重载了调用重载函数,否则调用自身实现,最后导出的时候直接导出wa ...
- Python数据聚合和分组运算(2)-Data Aggregation
在上一篇博客里我们讲解了在python里运用pandas对数据进行分组,这篇博客将接着讲解对分组后的数据进行聚合. 1.python 中经过优化的groupy方法 先读入本文要使用的数据集tips. ...
- 关于SqlDataReader使用的一点疑惑
C#中的SqlDataReader类(System.Data.SqlClient)是用来在保持打开数据库连接的状态下取数据用的 用法如下图: “保持与数据库的连接”这个特性也是SqlDataReade ...
- CodeForces - 906D Power Tower(欧拉降幂定理)
Power Tower CodeForces - 906D 题目大意:有N个数字,然后给你q个区间,要你求每一个区间中所有的数字从左到右依次垒起来的次方的幂对m取模之后的数字是多少. 用到一个新知识, ...
- 谢特——后缀数组+tire 树
题目 [题目描述] 由于你成功地在 $ \text{1 s} $ 内算出了上一题的答案,英雄们很高兴并邀请你加入了他们的游戏.然而进入游戏之后你才发现,英雄们打的游戏和你想象的并不一样…… 英雄们打的 ...
- 在eclipse中打开文件所在的目录
eclipse中默认是不能直接打开文件所在的目录的,需要在文件中右键-->properties-->location,复制到资源管理器中才能打开文件所在的目录.这种方法很麻烦.这里介绍一种 ...
- springboot 简单自定义starter - beetl
使用idea新建springboot项目beetl-spring-boot-starter 首先添加pom依赖 packaging要设置为jar不能设置为pom<packaging>jar ...
- Proxy模式(代理[延迟]模式)
Proxy?? Proxy是"代理人"的意思,它指的是代替别人进行工作的人.代理实际上就是使用委托的机制,在代理的过程中你可以做点其他的事情,然后再来执行被代理对象的代码. 知识储 ...