When you use marginLeft , you are applying the left (fixed) margin of the element in the LTR view. If you use marginStart , this margin applies to the (relative) start. In the case of the LTR view is the left of the element, but in the case of the RLT is the right of the element.
android:layout_marginTop Specifies extra space on the top side of this view. This space is outside this view's bounds. Margin values should be positive. May be a dimension value, which is a floating point number appended with a unit such as " 14.5sp ".
Margin specifies the space left on four sides in the layout and padding specifies the exact position where the element going to be taking place in the layout.
Margin specifies an extra space outside that View on which we applied Margin. In simple words, Margin means to push outside. Diagrammatically, the margin is shown below: Syntax: android:layout_margin=”size in dp”
For left-to-right flow, start=left, end=right.
For right-to-left flow, start=right, end=left.
The "start" and "end" concepts were added in API Level 17, as part of Android 4.2's support for RTL layouts.
Android supports RTL layouts from API 17+ i.e., Android 4.2 (Jelly Bean).and when we make our layout to support both RTL and LTR then we can not use layout_marginleft and layout_marginRight there we use layout_marginstart and layout_maginend .
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With