<?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"> <Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/center"
android:text="中间"
android:layout_centerInParent="true"/> <Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/above"
android:text="上面"
android:layout_above="@id/center"
android:layout_alignLeft="@id/center"/> <Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/below"
android:text="下面"
android:layout_alignLeft="@id/center"
android:layout_below="@id/center"/> <Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/left"
android:text="左边"
android:layout_below="@id/above"
android:layout_toLeftOf="@id/center"/> <Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/right"
android:text="右边"
android:layout_above="@id/below"
android:layout_toRightOf="@id/center"/> <Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="左上角/这是默认值"/> <Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="右上角"
android:layout_alignParentRight="true"/> <Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="左下角"
android:layout_alignParentBottom="true"/> <Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="右下角"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"/>
</RelativeLayout>

相对布局--RelativeLayout的更多相关文章

  1. Android相对布局(RelativeLayout)

    Android相对布局(RelativeLayout) 备注:这里的视图和元素是等同的概念. RelativeLayout是一个允许子视图相对于其他兄弟视图或是父视图显示的视图组(通过ID指定).每个 ...

  2. Android 自学之相对布局 RelativeLayout

    相对布局(RelativeLayout),相对布局容器内子组件的位置总是相对兄弟组件.父容器来决定的. RelativeLayout的XML属性及相关方法说明 XML属性 相关方法 说明 androi ...

  3. .Net程序猿玩转Android开发---(7)相对布局RelativeLayout

                 相对布局RelativeLayout是Android布局中一个比較经常使用的控件,使用该控件能够布局出适合各种屏幕分辨率的布局,RelativeLayout採用相对位置进行 ...

  4. Xamarin.Forms的相对布局RelativeLayout

    Xamarin.Forms的相对布局RelativeLayout   相对布局RelativeLayout是App中常用的布局方式.它是以界面中的某个元素为基准,设置另外一个元素的位置和大小.通过这种 ...

  5. Android学习笔记(14):相对布局RelativeLayout

    相对布局RelativeLayout,继承自ViewGroup.相对布局的子组件的位置总是相对于兄弟组件或者父容器决定的. RelativeLayout支持的XML属性: android:gravit ...

  6. Android布局_相对布局RelativeLayout

    一.RelativeLayout(相对布局)概述 RelativeLayout是相对布局控件,它包含的子控件将以控件之间的相对位置或者子类控件相对父类容器的位置的方式排列 二.RelativeLayo ...

  7. 相对布局RelativeLayout

      一. public class RelativeLayout extends ViewGroup java.lang.Object    ↳ android.view.View      ↳ an ...

  8. 线性布局LinearLayout和相对布局RelativeLayout 之间的比较

    LinearLayout和RelativeLayout之间: 共有属性:java代码中通过btn1关联次控件android:id="@+id/btn1" 控件宽度android:l ...

  9. 定义自己的布局RelativeLayout 绘制网格线

    在Android画线必须由一个载体,无论是控制,无论是布局.实际上它们是从继承View.由画线的方式自己的控制或布局的定义是最常见的. 以下是在其定义中的小样本实现RelativeLayout绘制网络 ...

  10. Android开发之布局--RelativeLayout布局

    RelativeLayout 相对布局 true或false属性 Layout_centerHorizontal   当控件位于父控件的横向中间位置 Layout_centerVertical   当 ...

随机推荐

  1. 什么是ODBC和JDBC?

    jdbc是使用通过JAVA的数据库驱动直接和数据库相连,而jdbc-odbc连接的是ODBC的数据源,真正与数据库建立连接的是ODBC! 建议使用JDBC直接连接,同时最好使用连接池! JDBC 是 ...

  2. 记录---IIS显示asp.net程序的具体错误

    原来IIS设置成显示单一的错误页面 但是最近的服务器页面报错,但是本地确实完好的:所以想着让服务器显示具体的报错 网上找到两种方法: 先说第一种有效的: 通过 web.config 配置 其实,上面在 ...

  3. iOS Keychain 跨应用

    Keychain 可以用来持久保存一些信息.通常每个应用都有自己的 Keychain Access.但有时你会需要多个应用共用一些信息.这时需要创建 Keychain Access Group. Ke ...

  4. 激活IDEA,pycharm方法

    1.修改hosts文件将0.0.0.0 account.jetbrains.com添加到hosts文件最后,注意hosts文件无后缀,如果遇到无法修改或权限问题,可以采用覆盖的方法去替换hosts文件 ...

  5. 【OCP题库】最新CUUG OCP 12c 071考试题库(66题)

    66.(22-19)choose two Examine the structure proposed for the TRANSACTIONS table: Which two statements ...

  6. “全栈2019”22篇Java异常学习资料及总结

    难度 初级 学习时间 10分钟 适合人群 零基础 开发语言 Java 开发环境 JDK v11 IntelliJ IDEA v2018.3 文章原文链接 "全栈2019"22篇Ja ...

  7. 【vim】正常模式下的一般操作

    正常模式一般用于浏览文本,其实也就是通过键盘命令让光标在文本中跳来跳去,在任何模式下按一次或两次<Esc>会进入正常模式. 基本思想 vim对光标的定位操作非常精确和高效,这是它的一个非常 ...

  8. 官宣,PyTorch 1.0 稳定版本现已推出

    简评:快来一起快乐地学习吧. 随着 PyTorch 生态系统和社区继续为开发人员提供有趣的新项目和教育资源,今天(12 月 7日)在 NeurIPS 会议上发布了 PyTorch 1.0 稳定版.研究 ...

  9. Hibernate 查询数据库中的数据

    1.Criteria介绍 Criteria与Session绑定,其生命周期跟随着Session结束而结束,使用Criteria时进行查询时,每次都要于执行时期动态建立物件,并加入各种查询条件,随着Se ...

  10. 服务器反爬虫攻略:Apache/Nginx/PHP禁止某些User Agent抓取网站

    我们都知道网络上的爬虫非常多,有对网站收录有益的,比如百度蜘蛛(Baiduspider),也有不但不遵守robots 规则对服务器造成压力,还不能为网站带来流量的无用爬虫,比如宜搜蜘蛛(YisouSp ...