Android EditText and Autocompletetextview set the text selection color method _android

Source: Internet
Author: User

EditText and Autocompletetextview set text selection color most of the Android ROM, text selected background color is very good bright green, but in some garbage Samsung mobile phone, incredibly blue, disgusting, in fact, can be completely through the program to modify , the text's default check background color.

The API used to explain

Copy Code code as follows:

Android:textcolorhighlight Color of the text selection highlight.

edittext Setting Effect

Autocompletetextview Setting effect

Implementation code

Copy Code code as follows:

<?xml version= "1.0" encoding= "Utf-8"?>
<linearlayout xmlns:android= "Http://schemas.android.com/apk/res/android"
Android:layout_width= "Match_parent"
android:layout_height= "Match_parent"
android:orientation= "Vertical" >
<edittext
Android:id= "@+id/et_inputbox"
android:layout_height= "Wrap_content"
Android:layout_width= "Match_parent"
android:textcolorhighlight= "#B4DF87"
/>

<autocompletetextview
Android:id= "@+id/act_input"
android:layout_below= "@id/et_inputbox"
Android:layout_width= "Fill_parent"
android:layout_height= "Wrap_content"
android:textcolorhighlight= "#B4DF87"
/>
</LinearLayout>

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.