1
我对使用下面的属性有点困惑。布局开始结束,左右概念
> android:layout_marginRight and android:layout_marginEnd
> android:layout_marginLeft and android:layout_marginStart
> android:layout_toLeftOf and android:layout_toStartOf
> android:layout_toRightOf and android:layout_toEndOf
> android:layout_gravity="right|end"
> android:layout_gravity="left|start"
下面是我提到的一些事实。请纠正我,如果我错了。
为了支持LTR和RTL布局和之前的API级别支持的版本17 是建议把上面的属性总是成对..
“开始”和“结束”在API级别17中加入概念并且将
优先用于与API级LTR设备> = 17,“右”和“左” 概念将优先为LTR设备与API级017如果OU我们可以忽略“right”和
“左”属性并仅使用“开始”和“结束”属性- “开始”和“结束”概念将优先于所有RTL 设备
此外,我想知道是否有在性能/优化方面的任何不利影响,如果我在上面添加成对属性喜欢 -
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right|end"
android:layout_marginRight="@dimen/dp10"
android:layout_marginEnd="@dimen/dp10"
android:layout_marginLeft="@dimen/dp10"
android:layout_marginStart="@dimen/dp10"
android:layout_toLeftOf="@+id/bar"
android:layout_toStartOf="@+id/bar"
/>