Use of shape in Android Development

Source: Internet
Author: User

Use of shape in Android Development
Android shape usage

Shape is used to set the shape. It can be used in selector, layout, and so on. There are 6 sub-labels. Each attribute is as follows:

Fill: Set the fill color

Interval: Set the interval in four directions.

Size: set the size.

Rounded corner: if five attributes are set at the same time, the Radius attribute is invalid.

Android: Radius = "20dp" sets the Radius of the four corners

Android: topLeftRadius = "20dp" sets the radius in the upper left corner.
Android: topRightRadius = "20dp" sets the radius in the upper right corner.
Android: bottomLeftRadius = "20dp" sets the radius in the lower right corner.
Android: bottomRightRadius = "20dp" sets the radius in the lower left corner.

Stroke: The dashWidth and dashGap attributes. If one of them is set to 0dp, the border is the implemented border.

Android: width = "20dp": Set the width of Edge
Android: color = "@ android: color/black" sets the edge color
Android: dashWidth = "2dp" set the width of the dotted line
Android: dashGap = "20dp" sets the interval width of the dotted line.

Gradient: No gradient effect after the fill color is set. The angle value must be a multiple of 45 (including 0) and only valid in type = "linear". Otherwise, an error is returned. Android: useLevel.

Start Point of the angle value

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: 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.