关于相对布局RelativeLayout的各种属性介绍
生活随笔
收集整理的這篇文章主要介紹了
关于相对布局RelativeLayout的各种属性介绍
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
2019獨角獸企業重金招聘Python工程師標準>>>
相對于兄弟元素android:layout_below="@id/aaa":在指定View的下方
android:layout_above="@id/xxx":在指定View的上方
android:layout_toLeftOf="@id/bbb":在指定View的左邊
android:layout_toRightOf="@id/cccc":在指定View的右邊
相對于父元素
android:layout_alignParentLeft="true":在父元素內左邊
android:layout_alignParentRight="true":在父元素內右邊
android:layout_alignParentTop="true":在父元素內頂部
android:layout_alignParentBottom="true":在父元素內底部
對齊方式
android:layout_centerInParent="true":居中布局
android:layout_centerVertical="true":水平居中布局
android:layout_centerHorizontal="true":垂直居中布局
android:layout_alignTop="@id/xxx":與指定View的上邊界一致
android:layout_alignBottom="@id/xxx":與指定View下邊界一致
android:layout_alignLeft="@id/xxx":與指定View的左邊界一致
android:layout_alignRight="@id/xxx":與指定View的右邊界一致
間隔
android:layout_marginBottom="";?離某元素底邊緣的距離
android:layout_marginLeft="";?離某元素左邊緣的距離
android:layout_marginRight?="";離某元素右邊緣的距離
android:layout_marginTop="";?離某元素上邊緣的距離
android:layout_paddingBottom="";?離父元素底邊緣的距離
android:layout_paddingLeft="";?離父元素左邊緣的距離
android:layout_paddingRight?="";離父元素右邊緣的距離
android:layout_paddingTop="";?離父元素上邊緣的距離
?
轉載于:https://my.oschina.net/u/1175401/blog/182655
總結
以上是生活随笔為你收集整理的关于相对布局RelativeLayout的各种属性介绍的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Daily scrum[2013.12.
- 下一篇: Gridcontrol新增行选中有关问题