Search code examples
androidxmlandroid-studioandroid-layoutlayout

How is margin start different from margin left and similarly margin end different from margin right in Android xml


So I was using the margins in Android XML and came across the two options which were doing the similar thing. Margin start and margin left were doing a similar thing, also margin end and margin right were doing same thing.

I was curious to know what is the difference between both of them ? And when should we use what ?


Solution

  • for different layout direction that is from API 17+:

    left to right flow, start=left, end=right.

    right to left flow, start=right, end=left.