Android EditText for arc backgrounds

Source: Internet
Author: User

I. Add a background to edittext, and 4 angle arc

The corresponding XML and style are as follows:

 <  edittext  android:id  = "@+id/o_item_num"   sty Le  = "@style/valuetextstyle"   Androi D:hint    Android:layout_h Eight  = "40.0dip"   Android:inputtype  = "number"   Android:singleline= "true"   Android:text  = "1"  />  
<stylename= "Valuetextstyle">        <Itemname= "Android:textsize">@dimen/txt_m</Item>        <Itemname= "Android:background">@drawable/edit_bg_selector</Item>        <Itemname= "Android:layout_width">Fill_parent</Item>        <Itemname= "Android:layout_height">Wrap_content</Item>        <Itemname= "Android:layout_marginleft">15.0dip</Item>        <Itemname= "Android:layout_margintop">10.0dip</Item>        <Itemname= "Android:layout_marginright">15.0dip</Item>        <Itemname= "Android:layout_marginbottom">10.0dip</Item>        <Itemname= "Android:layout_centervertical">True</Item>    </style>
<?XML version= "1.0" encoding= "Utf-8"?><selectorxmlns:android= "Http://schemas.android.com/apk/res/android">    <Itemandroid:state_enabled= "false"android:drawable= "@drawable/edit_text_disable" />    <Itemandroid:state_focused= "true"android:drawable= "@drawable/edit_text_focused" />    <Itemandroid:state_pressed= "true"android:drawable= "@drawable/edit_text_focused" />    <Itemandroid:drawable= "@drawable/edit_text" /></selector>

Of course, there is a way to define an arc shape to achieve

Android EditText for arc backgrounds

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.