From 6d262d0c9436f04c3abfeacc16a8229a9f01f029 Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Fri, 11 Aug 2023 09:42:18 +0800 Subject: [PATCH] =?UTF-8?q?6.5.4=E7=A4=BC=E7=89=A9=E5=86=A0=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/yunbao/live/views/FrameGiftViewHolder.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/live/src/main/java/com/yunbao/live/views/FrameGiftViewHolder.java b/live/src/main/java/com/yunbao/live/views/FrameGiftViewHolder.java index 86ce8a3ed..e89387d4e 100644 --- a/live/src/main/java/com/yunbao/live/views/FrameGiftViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/FrameGiftViewHolder.java @@ -62,12 +62,19 @@ public class FrameGiftViewHolder extends RecyclerView.ViewHolder { } public void showData(int contextLayoutGiftHeight, LiveGiftBean model) { + //设置高度 itemView.post(new Runnable() { @Override public void run() { GridLayoutManager.LayoutParams linearParams = (GridLayoutManager.LayoutParams) itemView.getLayoutParams(); - linearParams.height = contextLayoutGiftHeight / 2; + int giftHeight = 607; + if (contextLayoutGiftHeight > 607) { + giftHeight = 607; + } else { + giftHeight = contextLayoutGiftHeight; + } + linearParams.height = (giftHeight-30) / 2; itemView.setLayoutParams(linearParams); } });