[Widget]HeaderFooterGridView-头尾GridView

HeaderFooterGridView头尾GridView,支持AUTO_FIT模式,头尾模式有两种,无反射代码。
摘要由CSDN通过智能技术生成

HeaderFooterGridView

ICON

头尾GridView,支持AUTO_FIT模式,头尾模式有两种,无反射代码。

预览

Screenshots

要求

minSdkVersion 4

链接

使用

  • 基本布局
<am.widget.headerfootergridview.HeaderFooterGridView
    android:id="@+id/gird_hfg_content"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:columnWidth="64dp"
    android:gravity="center"
    android:horizontalSpacing="10dip"
    android:numColumns="auto_fit"
    android:stretchMode="columnWidth"
    android:verticalSpacing="10dip" />
  • 基本代码
HeaderFooterGridView hfgContent = (HeaderFooterGridView) findViewById(id);
hfgContent.addHeaderView(headerView);
hfgContent.removeHeaderView(headerView);
hfgContent.addHeaderItem(headerItem);
hfgContent.removeHeaderItem(headerItem);
hfgContent.addHeaderItem(headerItem, null, true);
hfgContent.addFooterItem(footerItem);
hfgContent.removeFooterItem(footerItem);
hfgContent.addFooterItem(footerItem, null, true);
hfgContent.addFooterView(footerView);
hfgContent.removeFooterView(footerView);

注意

  • 空白站位View占用GridView的子项position,处理position时需要小心
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值