如何改变的GridView的形状的Android

问题描述:

我想改变的GridView的形状,并四舍五入。其默认的形状为矩形。所以,请建议我该如何解决这个问题.. 谢谢..如何改变的GridView的形状的Android

+0

如果有人知道请建议。 – 2012-03-19 06:36:59

+0

你问关于每个网格项或整个gridview的形状? – 2012-03-19 06:45:56

+0

是啊.....真的,我的意思是.. – 2012-03-19 07:27:47

对于每个项目你可以添加一个新的视图与其他圆角上方。例如,您可以像这样创建一个GridView项目:

<?xml version="1.0" encoding="utf-8"?> 
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" > 

    <ImageView 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:layout_gravity="center" 
     android:scaleType="fitCenter" 
     android:src="@drawable/grid_default_cover_artist" /> 

    <View 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:layout_gravity="center" 
     android:background="@drawable/cover_borders" /> 

</FrameLayout> 

其中第二个视图是带角的可绘制对象。