|
@@ -62,7 +62,7 @@ public class TemplateAdapter extends BaseQuickAdapter<String, BaseViewHolder> {
|
|
|
|
|
|
|
|
int imageWidth = resource.getIntrinsicWidth();
|
|
int imageWidth = resource.getIntrinsicWidth();
|
|
|
int imageHeight = resource.getIntrinsicHeight();
|
|
int imageHeight = resource.getIntrinsicHeight();
|
|
|
- // 减去间距
|
|
|
|
|
|
|
+ // 手动计算高度,防止上下的巨大空白
|
|
|
int height = (SizeTool.SCREEN_WIDTH - mDividerSize * TemplateFragment.SPACE_LINES) / TemplateFragment.SPAN_COUNT * imageHeight / imageWidth;
|
|
int height = (SizeTool.SCREEN_WIDTH - mDividerSize * TemplateFragment.SPACE_LINES) / TemplateFragment.SPAN_COUNT * imageHeight / imageWidth;
|
|
|
ViewGroup.LayoutParams para = iv_template.getLayoutParams();
|
|
ViewGroup.LayoutParams para = iv_template.getLayoutParams();
|
|
|
para.height = height;
|
|
para.height = height;
|