<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent"> <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="#ccff66" android:layout_alignParentBottom="true" android:layout_alignParentRight="true" /> <!-- layout_alignParent+方向:对齐(如上面是向下,向右对齐)--> <View android:id="@+id/view_3" android:layout_width="100dp" android:layout_height="100dp" android:background="#FF0033" android:layout_toRightOf="@id/view_1" /> <!-- layout_toRightOf(在某一view的右侧),layout_below是在下边--> <LinearLayout android:id="@+id/ll_1" android:layout_width="match_parent" android:layout_height="200dp" android:layout_below="@id/view_1" android:orientation="horizontal" android:background="#0066FF" android:padding="15dp"> <View android:layout_width="100dp" android:layout_height="match_parent" android:background="#FF0033"/> <!-- 内边距padding15dp--> <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="#FF9900"/> <View android:id="@+id/view_5" android:layout_width="100dp" android:layout_height="match_parent" android:layout_marginLeft="10dp" android:layout_toRightOf="@id/view_4" android:background="#FF9900" /> </RelativeLayout> </LinearLayout> </RelativeLayout>
本文地址:https://blog.csdn.net/weixin_45884316/article/details/107732769
如对本文有疑问, 点击进行留言回复!!
Execution failed for task ‘:app:checkDebugDuplicateClasses‘解决方案
Cleartext HTTP traffic to pic1.win4000.com not permitted不允许明文http访问解决
Android SDK 26以后ant编译错误解决办法(错误信息:taskdef A class needed by class com.android.ant.GetUiTargetTask)
android8.1 mtk camera hal各种操作流程
Android 软键盘在有scollview,纵向viewpager+recyclview实现列表,或者recyclview, 把布局顶上去的问题,保证背景不会发生变化
Android开发使用MateriDesign(一套全新的界面设计语言)
网友评论