首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在回收站gridview最后一张图片中实现查看更多选项

如何在回收站gridview最后一张图片中实现查看更多选项
EN

Stack Overflow用户
提问于 2016-06-02 21:25:52
回答 1查看 225关注 0票数 0

像脸书饲料,如果图片超过5,那么剩余的图片计数与+是显示如下,I would like implement same in my app feed,如何处理它与回收视图,任何建议请。

EN

回答 1

Stack Overflow用户

发布于 2016-06-02 22:40:15

在适配器中创建如下布局:

代码语言:javascript
复制
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
                      android:layout_width="match_parent"
                      android:layout_height="match_parent"
            >

    <ImageView
        android:id="@+id/simpleImage"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        />

        <RelativeLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            visibility="gone">
            <ImageView
                android:id="@+id/simpleImageWithNumber"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                />
            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerInParent="true"
                android:text="+5"/>
        </RelativeLayout>
</RelativeLayout>

在ViewHolder中初始化这两个镜像。

并在onBindViewHolder()中检查位置,如果是4,则加载simpleImageWithNumber,否则加载simpleImage

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/37593227

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档