<?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>

我学习的

 

 


android:layout_toRightOf="此处写id"设定在某个块的右边
结果

 



更多相关文章

  1. Android(安卓)SDK 源代码编译
  2. Android拍照、录像、录音代码范例
  3. Android(安卓)TabSwitcher自定义控件
  4. android制作一个简单登入界面的部分代码
  5. android控制home键 代码
  6. Android(安卓)网络操作(上传下载等)
  7. 动态创建ImageView视图
  8. Android之常用功能代码
  9. Android引入外部字体源代码

随机推荐

  1. Android(安卓)View的onClick事件监听
  2. Android(安卓)UI绘制流程(一)
  3. Android入门教程(八)之-----简单的Button
  4. Android(安卓)NDK学习笔记6-JNI对引用数
  5. 朝花夕拾-android 自定义toast
  6. # Android+Java后端(Springboot,Mybatis)开
  7. Android(安卓)RxJava操作符详解系列: 创建
  8. 给Android封装的一个简单网络请求框架
  9. ReactNative中把js编译成bundle后,js引用
  10. Android开发最佳实践