从这里获取:
stackoverflow/a/36003935/6007737
它如何给我一个环形?
How is it giving me a ring shape?
layer-list的工作原理以及顶部,右侧的作用是什么?
How layer-list works and What do top, right, bottom and left attributes of item tag do?
不能只用环形形状吗?为什么要用椭圆形做成环形形状呢? / p>
Cant we just use ring shape ?Why go for oval shape to make ring shape?
推荐答案
层列表是可绘制的,称为带有的其他可绘制对象的序列< item> 标记。 从您的问题中,第一个< item> 是内部椭圆形&上,下,右&左边是赋予该项目的插图(与填充相同)。尝试提供宽度&首先,您可以看到椭圆形的内部形状,外部椭圆形具有4dp填充。
A layer list is drawable, called sequence of other drawables with <item> tag. Here from your question the first <item> is inner oval shape & top, bottom, right & left are insets given to that item (just same as padding). Try to give width & height to first you can see inner oval shape with 4dp padding from outer oval.
有关可绘制图层的详细信息,请参见此链接 developer.android/reference/android/graphics/drawable/LayerDrawable.html
Refer to this link for more detail about layer drawable developer.android/reference/android/graphics/drawable/LayerDrawable.html
是的,您可以使用环形形状像这样绘制圆环:
Yes you can use ring shape to draw a ring like:
<?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="schemas.android/apk/res/android" android:shape="ring" android:innerRadius="15dp" android:thickness="10dp" android:useLevel="false"> <solid android:color="#ff0000" /> </shape>更多推荐
无法理解图层列表
发布评论