一 、相对布局
RelativeLayout 相对布局
RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
1 页面右下布局
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"!
2 在**@+id/view_1**方块的右面
android:layout_toRightOf="@id/view_1"
3 在**@+id/view_1**方块的下面
android:layout_below="@+id/view_1"
线性和相对代码综合:
<?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">
<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="#00FF80"
android:layout_below="@+id/view_1"/>
<LinearLayout
android:id="@+id/ll_1"
android:layout_width="match_parent"
android:layout_height="200dp"
android:layout_below="@id/view_2"
android:orientation="horizontal"
android:background="#AEB404"
android:padding="15dp" >
<View
android:layout_width="100dp"
android:layout_height="match_parent"
android:background="#B40404"/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#000000"
android:padding="15dp">
<View
android:id="@+id/view_3"
android:layout_width="100dp"
android:layout_height="match_parent"
android:background="#00FF80"
android:layout_marginRight="15dp"
/>
<View
android:id="@+id/view_4"
android:layout_width="100dp"
android:layout_height="match_parent"
android:background="#A9A9F5"
android:layout_toRightOf="@id/view_3"
/>
</RelativeLayout>
</LinearLayout>
</RelativeLayout>
注意:android:id=“xxxxx”使用:驼峰式命名法
原创:https://www.panoramacn.com
源码网提供WordPress源码,帝国CMS源码discuz源码,微信小程序,小说源码,杰奇源码,thinkphp源码,ecshop模板源码,微擎模板源码,dede源码,织梦源码等。专业搭建小说网站,小说程序,杰奇系列,微信小说系列,app系列小说
免责声明,若由于商用引起版权纠纷,一切责任均由使用者承担。
您必须遵守我们的协议,如果您下载了该资源行为将被视为对《免责声明》全部内容的认可-> 联系客服 投诉资源www.panoramacn.com资源全部来自互联网收集,仅供用于学习和交流,请勿用于商业用途。如有侵权、不妥之处,请联系站长并出示版权证明以便删除。 敬请谅解! 侵权删帖/违法举报/投稿等事物联系邮箱:2640602276@qq.com未经允许不得转载:书荒源码源码网每日更新网站源码模板! » RelativeLayout 相对布局笔记
关注我们小说电影免费看关注我们,获取更多的全网素材资源,有趣有料!120000+人已关注
评论抢沙发