Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is android:layout_marginStart

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".

like image 342
null Avatar asked Sep 19 '14 12:09

null


People also ask

What is RelativeLayout?

RelativeLayout is a view group that displays child views in relative positions. The position of each view can be specified as relative to sibling elements (such as to the left-of or below another view) or in positions relative to the parent RelativeLayout area (such as aligned to the bottom, left or center).

What is a FrameLayout in android?

FrameLayout is designed to block out an area on the screen to display a single item. Generally, FrameLayout should be used to hold a single child view, because it can be difficult to organize child views in a way that's scalable to different screen sizes without the children overlapping each other.

Why do we use constraint layout in android?

A ConstraintLayout is a ViewGroup which allows you to position and size widgets in a flexible way. Note: ConstraintLayout is available as a support library that you can use on Android systems starting with API level 9 (Gingerbread). As such, we are planning on enriching its API and capabilities over time.

What is the difference between padding and margin in android?

Note that padding goes completely around the content: there is padding on the top, bottom, right and left sides (which can be independent). Margins are the spaces outside the border, between the border and the other elements next to this view. In the image, the margin is the grey area outside the entire object.


2 Answers

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.

like image 155
CommonsWare Avatar answered Oct 16 '22 16:10

CommonsWare


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

like image 35
AndroidEnthusiast Avatar answered Oct 16 '22 16:10

AndroidEnthusiast