From 8103c738a7993010c553c8d1b1fcf95417d7128b Mon Sep 17 00:00:00 2001 From: liqi Date: Wed, 31 Oct 2018 18:23:42 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E6=96=B0=E8=AE=BE=E5=AE=9A=E5=B8=83?= =?UTF-8?q?=E5=B1=80=E5=8F=82=E6=95=B0=EF=BC=8C=E9=87=8D=E8=B5=B0=E5=B8=83?= =?UTF-8?q?=E5=B1=80=E7=AD=96=E7=95=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ninegridimageview/NineGridImageView.java | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/library/src/main/java/com/jaeger/ninegridimageview/NineGridImageView.java b/library/src/main/java/com/jaeger/ninegridimageview/NineGridImageView.java index 769143d..c861f14 100644 --- a/library/src/main/java/com/jaeger/ninegridimageview/NineGridImageView.java +++ b/library/src/main/java/com/jaeger/ninegridimageview/NineGridImageView.java @@ -683,7 +683,8 @@ public void setAdapter(NineGridImageViewAdapter adapter) { * @param gap 宫格间距 px */ public void setGap(int gap) { - mGap = gap; + mGap = gap; + requestLayout(); } /** @@ -692,8 +693,9 @@ public void setGap(int gap) { * @param showStyle 显示风格 */ public void setShowStyle(int showStyle) { - mShowStyle = showStyle; - } + mShowStyle = showStyle; + requestLayout(); + } /** * 设置只有一张图片时的尺寸大小 @@ -701,7 +703,8 @@ public void setShowStyle(int showStyle) { * @param singleImgSize 单张图片的尺寸大小 */ public void setSingleImgSize(int singleImgSize) { - mSingleImgSize = singleImgSize; + mSingleImgSize = singleImgSize; + requestLayout(); } /** @@ -710,8 +713,9 @@ public void setSingleImgSize(int singleImgSize) { * @param maxSize 最大图片数 */ public void setMaxSize(int maxSize) { - mMaxSize = maxSize; - } + mMaxSize = maxSize; + requestLayout(); + } public void setItemImageClickListener(ItemImageClickListener itemImageViewClickListener) { mItemImageClickListener = itemImageViewClickListener; @@ -720,4 +724,4 @@ public void setItemImageClickListener(ItemImageClickListener itemImageViewCli public void setItemImageLongClickListener(ItemImageLongClickListener itemImageViewLongClickListener) { mItemImageLongClickListener = itemImageViewLongClickListener; } -} \ No newline at end of file +}