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); } });