Android开发之实现GridView支付宝九宫格

2019-12-10 19:53:19刘景俊
  • android:layout_margin="0.0dip"  android:background="@color/griditems_bg" >  
  • <RelativeLayout   android:layout_width="fill_parent" 
  • android:layout_height="fill_parent"  android:layout_centerInParent="true" 
  • android:background="@drawable/bg_gv"  android:padding="12.0dip" >  
  • <ImageView   android:id="@+id/iv_item" 
  • android:layout_width="58.0dip"  android:layout_height="58.0dip" 
  • android:layout_centerHorizontal="true"  android:contentDescription="@string/app_name" />  
  • <TextView   android:id="@+id/tv_item" 
  • android:layout_width="wrap_content"  android:layout_height="wrap_content" 
  • android:layout_below="@id/iv_item"  android:layout_centerHorizontal="true" 
  • android:layout_marginTop="5.0dip"  android:maxLines="1" 
  • android:textColor="@color/commo_text_color"  android:textSize="14.0sp" />  
  • </RelativeLayout>   </RelativeLayout> 

    到这里,就要开始写代码了,定义一个Adapter,把数据填充到GridView中,这一步我想大家都应该都很清楚,这里就不多讲了,不懂的话,可以参考下面的项目代码。


    注:相关教程知识阅读请移步到Android开发频道。