Android 如何用xml设置外部形状的背景?透明圈
如何使用白色矩形中的透明圆制作布局样式 若我使圆的背景透明,那个么我只看到白色的矩形,我知道为什么,有什么可能的解决办法吗? 这样地: 无边框创建可绘制的xml:Android 如何用xml设置外部形状的背景?透明圈,android,layout,styles,Android,Layout,Styles,如何使用白色矩形中的透明圆制作布局样式 若我使圆的背景透明,那个么我只看到白色的矩形,我知道为什么,有什么可能的解决办法吗? 这样地: 无边框创建可绘制的xml: <?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item> <shape xmlns:andr
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle"
android:useLevel="false">
<solid android:color="@android:color/white" />
</shape>
</item>
<item>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="ring"
android:thicknessRatio="2"
android:innerRadius="0dp"
android:useLevel="false">
<solid android:color="@android:color/darker_gray" />
</shape>
</item>
</layer-list>
不是在xml中,我担心还有另外两种方式:1。您可以将这样的图像设置为布局2的背景。您可以创建xml Drawable并将其设置为布局背景。您可以使用9个补丁。谢谢。9-补丁工作;