Rounded background implementation, such as the implementation of rounded buttons; drawing a circle with an XML file

Source: Internet
Author: User

In order to better visual effects in the project, and then lazy to get pictures to do the background, often through the XML layout file to achieve the effect of rounded corners.

Create a new shape-type XML file under the Drawable directory, set <corners android:radius= "5DP"/>, and then in a control that needs to be rounded, such as a button or linearlayout, Set their background to drawable= "@drawable/...". To achieve rounded corners

Draw a circle with an XML file

Use the vertical bar to connect the ListView item, according to the date to block, in the day when the display is the date.
Like such a circle, you can add a ball.xml file of shape type to the drawable to set

<android:radius= "6DP"/><solid    Android:color= "@android: Color/gray"/><stroke    Android:color= "@android: Color/gray"/>

Then set a view in the ListView item layout and set the Ball.xml to the background of the view

< View      Android:layout_width = "6DP"     android:layout_height= "6DP"    android:background= "@drawable/ball" />

Rounded background implementation, such as the implementation of rounded buttons; drawing a circle with an XML file

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.