The difference between Android MarginLeft and Marginstart

Source: Internet
Author: User

When writing layout layouts, we find that there are several more similar properties:
Marginstart marginleft

Marginend marginright


What are the differences between these attributes? According to the API note, we know that Marginstart refers to the distance between the control and the view portion of the beginning, and marginleft refers to the distance between the control and the left view. Marginend and MarginRight.


In general, the view begins with the left, but some languages are now written in the right-to-left order, such as in Arabic, after the Android 4.2 system, Google introduced RTL layouts in Android. Better supported by right-to-left text layout display, in order to better compatible with RTL layout, Google recommends using Marginstart and marginend to replace MarginLeft and MarginRight, This allows the app to maintain a consistent user experience on both a normal screen and a screen that displays text from right to left.

The following is an excerpt from the Chinese Android 4.2API that others have translated:
    Android 4.2 introduces a full local support layout for right-to-left text. With local RTL support, you can create the perfect app experience for all users, whether they're written in a left-to-right or right-to-left direction. When the user switches the system language to right-to-left notation, the system provides an automatic application UI layout and mirroring of all visual components, including the display and input of text elements. Your app can support RTL layout mirroring with minimal changes. If your app supports this feature, simply change all the "left/right" layout properties to the corresponding "Start/end" in your app's manifest file. The system will process your UI as needed.                

The difference between Android MarginLeft and Marginstart

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.