What is the difference between layout_alignStart and layout_alignLeft tag?

I am developing an Android application and use the layout_alignStart tag. This worked well until I tested my application on an old device. Then I realized that layout_alignStart is only supported in API 17.

Reading the documentation, it made sense to replace all of these layout_alignStart with layout_alignLeft.

However, I want to know what is the real difference between these two tags?

+5
source share
3 answers

This is due to RTL screens (from right to left). In some languages, a line of text starts on the right and ends on the left. Using "start" instead of "left" and "end" instead of "right" ensures that your layouts look consistent on RTL screens.

+13
source

The main reference is to the place where the layout begins.

It can be either right or left, simply based on how you align the layout.

If start = left, then end = right and vice versa.

This attribute is designed to create more dynamic layouts that work in different cases.

+3
source

Both layout properties displayed the view in the user interface, but matching this left / start view with the left / start edge, another specified view.

On Android, the layout_alignLeft attribute layout_alignLeft used to support older versions of the API. Api 17 added layout_alignStart and layout_alignEnd for "Right-to-Left", so "RTL" and "LTR" can be written.

Left to right: End = Right, Start = Left

Left to Right: End = Left, Start = Right

0
source

Source: https://habr.com/ru/post/1201353/


All Articles