我怎样才能创建的GridView Android上的圆角矩形边框? [英] How can I create a rounded rectangular border for GridView on Android?

查看:328
本文介绍了我怎样才能创建的GridView Android上的圆角矩形边框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在Android上创建GridView的圆角矩形边框像下图:

I want to create a rounded rectangular border for GridView on Android like the below image:

我怎样才能做到这一点?先谢谢了。

How can i achieve this? Thanks in advance.

推荐答案

创建绘制形状,跟踪并设置为背景,以你的观点:

create a drawable shape as follow and set as background to your 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>

P.S。这只会造成一个圆角矩形

P.S. this will only create a round-corner rectangle

这篇关于我怎样才能创建的GridView Android上的圆角矩形边框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆