5

I'm developping an Android application and I used the layout_alignStart tag. It worked well, until I tested my app on an older device. I then realized that layout_alignStart was only supported in api 17.

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

However, I want to know what's the actual difference between these two tags?

Cœur
  • 37,241
  • 25
  • 195
  • 267
Goldorak84
  • 3,714
  • 3
  • 38
  • 62
  • I don't see how you don't see that they are both about the difference between start and left and end and right – Tim Jan 19 '18 at 19:36
  • Read the doc about duplicates, learning that it's not a bad thing. Sorry abt that – Goldorak84 Jan 19 '18 at 19:47

3 Answers3

13

This is related to RTL (Right-To-Left) screens. 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" will ensure that your layouts look consistently on RTL screens.

Egor
  • 39,695
  • 10
  • 113
  • 130
3

Start basically refers the place where your layout starts.

It can be either right or left, simply based on how you layout is aligned.

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

This attribute is ment to create more dynamic layouts which work on different occasions.

Simas
  • 43,548
  • 10
  • 88
  • 116
0

Both layout property drawn the view in user interface but matching this view's left/start edge with the left/start edge another specified view.

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

Left-to-Right : End= Right , Start=Left

Right-to-Left: End= Left, Start=Right