Android design Layout in Arabic under the interface of the confusion solution

Source: Internet
Author: User

(1) Adding "Android:supportsrtl=true" (2) to the application element of the Androidmanifest.xml declaration file]

Androidの design Layout in Arabic under the interface Confusion solution

(1) in the element of the Androidmanifest.xml declaration file, add "Android:supportsrtl=true"
(2) Modify the "Left/right" layout property of layout in the application to the corresponding "Start/end" layout
Paddingstart paddingend layout_marginstart layout_marginend layout_alignparentstart layout_alignParentEnd
Replace
Paddingleft paddingright layout_marginleft layout_marginright layout_alignparentleft layout_alignParentRight
(3) Mixed characters or plain English, TextView does not reside right. For example, some of the English characters in the list are displayed on the left, and the translated ones are displayed on the right.
Locate the layout file for which it is defined
Replace Wrap_content with match_parent, if no effect is added after replacement
android:textdirection= the "locale" attribute.
Code control
String language = Locale.getdefault (). GetLanguage ();
if (Language.equals ("ar") "|language.equals (" FA ")) {
TextView TextView = (TextView) view;
Textview.setgravity (Gravity.right);
(4) For some problems with the wrong orientation of the picture
For these images you need to follow the redesign and then drop them into the drawable-ldrtl-hdpi folder

Android design Layout in Arabic under the interface of the confusion solution

Related Article

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.