Consider adding android:paddingstart= "25DP" to better support right-to-left layouts Error

Source: Internet
Author: User

This problem is encountered when setting the Padding property on EditText on Android after updating ADT:

Multiple annotations found at the line:
-Consider adding android:paddingstart= "25DP" to better support right-to-left
Layouts
-When you define paddingleft your should probably also define paddingright for
Right-to-left symmetry

Set the XML code as follows:

<edittext            android:id= "@+id/et_search_searchtext"            android:layout_width= "Fill_parent"            android: layout_height= "Wrap_content"            android:hint= "search"            android:layout_centervertical= "true"            android:layout _toleftof= "@+id/bt_search_search"            android:layout_marginright= "5DP"            android:layout_marginleft= "5DP"            android:background= "@drawable/search_box_1"            android:ellipsize= "End"            android:paddingleft= "25DP"// Error code            android:ems= ">        </EditText>

Workaround:

1. Cause Analysis:

android: Paddingstart is a the newly launched label on Android 4.2 plays with .

now the RTL level means right to left. layouts are used in RTL language such as in Arabic .

so, to develop the layout, you can add the same values to the left of the Paddingstart as the padding. so , when Android render RTL layout will consider paddingstart .

if your target is Android for your app 4.2 (Application Targetsdkversion or minsdkversion is 17 or higher), then you should use "Start" and "End", and not "left" and "right ”。 For example , android  : paddingleft should be Android : paddingstart .

If you want your app to work before the Android 4.2 version (the app's targetsdkversion or minsdkversion is 16 or less), then you should add "start" and " left" and "right". For example , you can use android paddingleft and Android :paddingstart.

2. Workaround:

android:paddingleft= "25DP"
Android:paddingstart= "25DP"
android:paddingright= "0DP"
Android:paddingend= "0DP"



Consider adding android:paddingstart= "25DP" to better support right-to-left layouts Error

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.