圆形的图片的:
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval"> <solid android:color="#94C5FF" /> <size android:width="20dp" android:height="20dp" /> </shape>正方形的只需要把
android:shape="oval"换成
android:shape="rectangle"也就是shape的属性。
本文详细介绍了如何在Android中通过XML定义各种形状的图片,包括圆形和正方形等不同样式,提供了一种在Android开发中自定义图片样式的解决方案。
2459





