Shape under the drawable

Source: Internet
Author: User

  1. Shape: Shapes
    1. Fillet:Corners: Set five properties at the same time, otherwise the RADIUS attribute is invalid
    2. Gradient:gradient When the fill color is set, no gradient, angle value must be a multiple of 45, including 0, only in type= "linear" valid, otherwise it will be error;
    3. Interval:padding: Set the interval in four directions
    4. Sizes: size
    5. Fill:Solid: Sets the color of the fill
    6. Strokes:Stroke
      1. <?xml version="1.0" encoding="utf-8"?>
      2. <shape xmlns:android="http://schemas.android.com/apk/res/android">
      3. <!--圆角-->
      4. <corners
      5. android:radius="9dp" <!-- set Four corner radii -
      6. android:topLeftRadius="2dp" <!-- set the upper-left corner radius -
      7. android:topRightRadius="2dp" <!-- set the upper right corner radius -
      8. android:bottomLeftRadius="2dp" <!-- set the lower left corner radius -
      9. android:bottomRightRadius="2dp"/><!--设置右下角半径-->
      10. <!--渐变-->
      11. <gradient
      12. android:startColor="@android:color/white"
      13. android:centerColor="@android:color/black"
      14. android:endColor="@android:color/black"
      15. android:useLevel="true"
      16. android:angle="45"
      17. android:type="radial"
      18. android:centerX="0"
      19. android:centerY="0"
      20. android:gradientRadius="90"/>
      21. <!--间隔-->
      22. <padding
      23. android:left="2dp"
      24. android:top="2dp"
      25. android:right="2dp"
      26. android:bottom="2dp"/><!--各方向的间隔-->
      27. <!--大小-->
      28. <size
      29. android:width="50dp"
      30. android:height="50dp"/><!--宽度和高度-->
      31. <!--填充-->
      32. <solid
      33. android:color="@android:color/white"/><!--填充的颜色-->
      34. <!--描边-->
      35. <stroke
      36. android:width="2dp" <!-- Set Stroke width -
      37. android:color="@android:color/black" <!-- Set Stroke color -
      38. android:dashWidth="1dp" <!-- set the dash width -
      39. android:dashGap="2dp"/><!-- Set Dash interval width -
      40. </shape>



From for notes (Wiz)



Shape under the drawable

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.