<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity"> <View
android:id="@+id/view_1"
android:layout_width="100dp"
android:layout_height="100dp"
android:background="#000000"
/>
<View
android:id="@+id/view_2"
android:layout_width="100dp"
android:layout_height="100dp"
android:background="#fa1919"
android:layout_below="@id/view_1"
/>
<LinearLayout android:id="@+id/view_3"
android:layout_width="match_parent"
android:layout_height="200dp"
android:layout_below="@id/view_2"
android:orientation="horizontal"
android:background="#0b56f9"
android:padding="15dp">
<View
android:layout_width="100dp"
android:layout_height="match_parent"
android:background="#fa1919"/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#000000"
android:padding="15dp">
<View
android:id="@+id/view_4"
android:layout_width="100dp"
android:layout_height="match_parent"
android:background="#3a75ff"/>
<View
android:id="@+id/view_5"
android:layout_width="100dp"
android:layout_height="match_parent"
android:background="#ecd931"
android:layout_toRightOf="@id/view_4"
android:layout_marginLeft="15dp"/>
</RelativeLayout>
</LinearLayout> </RelativeLayout>

我学习的

<RelativeLayout +代码 /></RelativeLayout>
android:layout_toRightOf="此处写id"设定在某个块的右边
结果

												

Android Studio [相对布局RelativeLayout]的更多相关文章

  1. 将Android Studio默认布局ConstraintLayout切换成LinearLayout

    将Android Studio默认布局ConstraintLayout切换成LinearLayout     大部分人初次使用google android 扁平化布局ConstraintLayout都 ...

  2. Android studio 基本布局-底部按钮

    在使用Android studio 的时候,准备弄的基本的布局出来,底部按钮,按了中间会显示. 来上代码: 页面menu_main.xml 这里弄控件的浮动耗费了点我的时间.原因是因为对其各种问题, ...

  3. 设置Android Studio工程布局文件的默认布局

    每次创建新的工程后,布局文件的的布局总是ConstraintLayout,如何更改? 进入Android Studio安装目录,用文本编辑器打开文件plugins\android\lib\templa ...

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

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

  5. Android studio简单布局之view基本属性

    本人属于自学上路,目前是在入门阶段,所以有些内容实质性比较少,请各位大佬多多包涵. 视图view的基本属性: layout_margin:定义视图与周围视图之间的空白距离 layout_padding ...

  6. Android Studio [水平布局LinearLayout]

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

  7. Android studio中布局文件出现render problem问题

    当做layout时,可能会出现render problem的情况.意思就是无法预览当前布局页面,这种情况是因为API版本太高造成的.只需要修改API为更低版本即可.

  8. Android Studio 学习笔记(二):布局简介和xmlns说明

    初学Android Studio,是在b站看的教程视频,这里的笔记也是以其为基础的,个人强烈安利: [天哥]Android开发视频教程最新版 Android Studio开发 Android 布局简介 ...

  9. Android开发自学笔记(Android Studio)—4.1布局组件

    一.引言 Android的界面是有布局和组件协同完成的,布局好比是建筑里的框架,而组件则相当于建筑里的砖瓦.组件按照布局的要求依次排列,就组成了用户所看见的界面.在Android4.0之前,我们通常说 ...

随机推荐

  1. 初学HTML5做的小知识点

    新增的HTML5标签 语义化标签 :<header> 头标签      <nav> 导航标签      <section> 表示文档的结构.栏目      < ...

  2. Spring Cloud Zuul的动态路由怎样做?集成Nacos实现很简单

    一.说明 网关的核心概念就是路由配置和路由规则,而作为所有请求流量的入口,在实际生产环境中为了保证高可靠和高可用,是尽量要避免重启的,所以实现动态路由是非常有必要的:本文主要介绍实现的思路,并且以Na ...

  3. JAVA 获取时间段内的每一天

    public class day { public static void main(String[] args) { // TODO Auto-generated method stub Strin ...

  4. 一文读懂HashMap

    推荐 转载:https://www.jianshu.com/p/ee0de4c99f87

  5. Python 基础(四)

    open函数 open(name[,mode[,buffering[,encoding]]]) mode(访问模式): -1 : r(只读) w(只写,若文件存在则覆盖) a(追加) rb(二进制只读 ...

  6. codeforces E. Mahmoud and Ehab and the function(二分+思维)

    题目链接:http://codeforces.com/contest/862/problem/E 题解:水题显然利用前缀和考虑一下然后就是二分b的和与-ans_a最近的数(ans_a表示a的前缀和(奇 ...

  7. CF - 1131 D Gourmet choice

    题目传送门 先把 = 的人用并查集合并在一起. 然后 < > 的建边, 跑一遍 toposort 之后就好了. 入度为0点的值肯定为1, 然后就是因为这个是按照时间线走过来的,所以一个点的 ...

  8. lightoj 1046 - Rider(bfs)

    A rider is a fantasy chess piece that can jump like a knight several times in a single move. A rider ...

  9. NOIP 2005 等价表达式 题解

    题意 给一个表达式然后再给n个表达式,判断是否等价 一道大模拟题,将a带为数,并且取模防止溢出 #include<bits/stdc++.h> using namespace std; c ...

  10. Spring中常用的23中设计模式

    1.spring 中常用的设计模式有23中  分类  设计模式  创建型 工厂方法模式(FactoryMethod).抽象工厂模式(AbstractFactory).建造者模式(Builder).原型 ...