仿微信群头像九宫格控件 LQRNineGridImageView

码农软件 · 软件分类 · Android UI 组件 · 2019-04-23 20:57:04

软件介绍

仿微信群头像九宫格控件

一、简介:

参照Android 仿微信群聊头像文章学习开发的一个仿微信群头像九宫格控件,感谢博主Loften_93663469。

效果如下:

二、使用:

1、在自己项目中添加本项目依赖:

compile 'com.lqr.ninegridimageview:library:1.0.0'

2、布局中使用:


app:imgGap="12dp"指头像间距,默认是8px。

3、代码中使用:

1)设置数据源:

ListmData1 = new ArrayList<>();
...
填充数据
...
mNgiv1.setImagesData(mData1);

2)设置适配器:

LQRNineGridImageViewAdapter adapter = new LQRNineGridImageViewAdapter() {
    @Override
    protected void onDisplayImage(Context context, ImageView imageView, String s) {
        ImageLoaderManager.LoadNetImage(s, imageView);
    }

    //重写该方法自定义生成ImageView方式,用于九宫格头像中的一个个图片控件,可以设置ScaleType等属性
    @Override
    protected ImageView generateImageView(Context context) {
        return super.generateImageView(context);
    }
};
mNgiv1.setAdapter(adapter);

本文地址:https://codercto.com/soft/d/4240.html

Learning Web Design

Learning Web Design

Jennifer Niederst Robbins / O'Reilly Media / 2007-6-15 / USD 44.99

Since the last edition of this book appeared three years ago, there has been a major climate change with regard to web standards. Designers are no longer using (X)HTML as a design tool, but as a means......一起来看看 《Learning Web Design》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

SHA 加密
SHA 加密

SHA 加密工具