What is android:layout_marginStart

家住魔仙堡 提交于 2020-07-17 09:49:22

问题


I would like to add some space between the left display border and an ImageView. Android SDK made me aware of "android:layout_marginStart".

Consider adding android:layout_marginStart="10dp" to better support right-to-left layouts

Why should I use android:layout_marginStart="10dp" instead of android:layout_marginLeft="10dp"? I have never done so and never encountered any problems with so-called "right-to-left layouts".


回答1:


start and end are the same as left and right for left-to-right (LTR) languages. For right-to-left (RTL) languages (Arabic, Hebrew, etc.), start and end reverse and become equivalent to right and left, respectively.

This Android Developers Blog post gets into a bit more detail.




回答2:


Some APIs were introduced to support languages that use a right to left reading direction e.g Arabic and Hebrew.

One of which is android:layout_marginStart

See the link for more info : http://developer.android.com/about/versions/android-4.2.html#RTL



来源:https://stackoverflow.com/questions/25934106/what-is-androidlayout-marginstart

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!