我想给GridView创建一个圆角矩形边界,就像以下的图像显示一样:
如何实现这个功能呢?
创建一个 drawable shape ,在 view 中设置为背景
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<solid android:color="#C0C0C0"></solid>
<stroke android:width="1dp" android:color="#000000"></stroke>
<corners android:radius="5dp"></corners>
</shape>
做一张9patch的圆角图片,设置成背景就可以了