“This is the fourth day of my participation in the Gwen Challenge in November. Check out the details: The Last Gwen Challenge in 2021.”

👉 About the author

As we all know, life is a long process of constantly overcoming difficulties and reflecting on progress. In this process, there will be a lot of questions and thoughts about life, so I decided to share my thoughts, experiences and stories to find resonance!!

Focus on Android/Unity and various game development tips, as well as various resource sharing (websites, tools, materials, source code, games, etc.)

Welcome to pay attention to the public account [Mr. Empty name] for more resources and communication!

👉 premise

This is small empty stay up late to write Android novice series, welcome to taste.

👉 Practice

😜 Shape attribute details


      
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:innerRadius="30dp"
    android:innerRadiusRatio="2"
    android:shape="ring"
    android:thickness="2dp"
    android:thicknessRatio="3"
    android:useLevel="false">
</shape>
Copy the code

Android: Shape =”line” rectangle (rectangle, oval, line, ring)

Android :innerRadius size, the radius of the inner ring, available only in the ring ring.

Android :innerRadiusRatio floating point. The radius of the inner ring is represented by the ratio of the width of the ring. For example, if the width of the ring is 50 and the ratio is 2.5, the radius of the inner ring is 20

It’s just the thickness of the ring

Android :thicknessRatio Floating point, which represents the thickness of the ring in terms of its width ratio, similar to innerRadiusRatio

Android :useLevel Boolean Specifies a Boolean value that must be added to it

😜 Details of child attributes

<corners// Define rounded cornersandroid:radius="10dp"// Full fillet radius, e.g.10dp  
    android:topLeftRadius="10dp"// The radius of the upper left corner, for example:10dp  
    android:topRightRadius="10dp"// The radius of the upper right corner, for example:10dp  
    android:bottomLeftRadius="10dp"// The radius of the lower left corner, for example:10dp  
    android:bottomRightRadius="10dp" />// The radius of the rounded corner in the lower right corner, for example, 10dp<solid android:color="#ffff00" />// Only one color, set the fill color.<gradient  
    android:type="linear"/ / there are3Medium gradient type, linear gradient (defaultlinear)/Radial gradient (radial)/Scan gradient (sweep)android:angle="0"// Gradient Angle, must be45A multiple of,0Is from left to right,90It works from top to bottom only in a linear gradientandroid:centerX="0.2"// Gradient centerXThe corresponding position of, and the range is0~1, mostly used in radial gradientandroid:centerY="0.1"// Gradient centerYThe corresponding position of, and the range is0~1, mostly used in radial gradientandroid:startColor="#ff0000"// The color of the beginning of the gradientandroid:centerColor="#ffff00"// The color of the middle point of the gradient, between the start and end pointsandroid:endColor="#00ff00"// Gradient the end point colorandroid:gradientRadius="10"// Radius of the gradient, only if the gradient type isradialCan only be usedandroid:useLevel="false" />// Attributes are not normally used. This property specifies whether the Shape is used as a LevelListDrawable. The default value is false.<stroke     
    android:width="dimension"// Represents the width of the strokeandroid:color="#00ff00"// Represents the color of the stroke, such as greenandroid:dashWidth="8dp"// The width of the dashed line is0Time is a solid line, for example8dpwideandroid:dashGap="1dp" />// The interval of the dashed line, for example, the interval is 1dpCopy the code

👉 other

📢 author: Kom and Kom in Kom

📢 reprint instructions – be sure to specify the source: Zhim Granular’s personal home page – column – Nuggets (juejin. Cn)

📢 welcome to like 👍 collect 🌟 message 📝