【发布时间】:2013-03-28 14:18:13
【问题描述】:
我正在尝试制作带有圆角的背景图像,以便在布局中进行设置。问题是如何在可绘制 XML 中为圆角设置图像,而不是使用纯色。
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" android:padding="10dp">
<!-- you can use any color you want I used here gray color-->
<solid android:color="#ffffff"/>
<corners
android:bottomRightRadius="10dp"
android:bottomLeftRadius="10dp"
android:topLeftRadius="10dp"
android:topRightRadius="10dp"/>
</shape>
【问题讨论】:
-
使用xml我认为你可以实现它
-
如果您的图像很少,那么您可以使用一些图像编辑软件(如 gimp 等)将图像裁剪到特定的角半径......
-
我使用 anymaking.com/round-photo-corners-editor.thanks 手动制作的,感谢你们帮助我...!