RTL布局默认是关闭的,如果想使用RTL布局,首先要在AndroidManifest.xml文件中将标签的android:supportsRtl属性值设为"true",然后需要将相应视图标签的android:layoutDirection属性值设为"rtl"。
注意:RTL布局常用android:layout_marginStart和android:layout_marginEnd来设置两个视图的间距。
android:layout_marginStart:如果在LTR布局模式下,该属性等同于android:layout_marginLeft。如果在RTL布局模式下,该属性等同于android:layout_marginRight。
android:layout_marginEnd:如果在LTR布局模式下,该属性等同于android:layout_marginRight。如果在RTL布局模式下,该属性等同于android:layout_marginLeft。
Android布局从右至左布局
最新推荐文章于 2021-05-26 03:32:33 发布