MagicIndicator icon indicating copy to clipboard operation
MagicIndicator copied to clipboard

关于layout_height="wrap_content"

Open CodingCodersCode opened this issue 6 years ago • 5 comments

为什么设置MagicIndicator的layout_height="wrap_content"不生效,反而垂直充满全屏,demo中是放在ScrollView中满足wrap的效果,但是正常使用,如何设置才能实现wrap效果?

CodingCodersCode avatar May 09 '18 03:05 CodingCodersCode

源码中出现这个: if (mNavigator instanceof View) { LayoutParams lp = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT); addView((View) mNavigator, lp); mNavigator.onAttachToMagicIndicator(); } 导致高度变成match

LLQQHH avatar May 06 '19 06:05 LLQQHH

同问

protectedMan avatar Aug 26 '19 02:08 protectedMan

源码中出现这个: if (mNavigator instanceof View) { LayoutParams lp = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT); addView((View) mNavigator, lp); mNavigator.onAttachToMagicIndicator(); } 导致高度变成match

不是这个原因,demo也是这样就没事。

protectedMan avatar Aug 26 '19 03:08 protectedMan

为什么设置MagicIndicator的layout_height="wrap_content"不生效,反而垂直充满全屏,demo中是放在ScrollView中满足wrap的效果,但是正常使用,如何设置才能实现wrap效果? demo中不放在ScrollView也正常wrap。 我的页面多次使用MagicIndicator,有的页面正常wrap有的就会充满全屏,不知道是哪里出了问题

protectedMan avatar Aug 26 '19 03:08 protectedMan

我的getIndicator 使用了LinePagerIndicator,如果返回null的话就正常wrap 如果返回来这个LinePagerIndicator 就match了 不知道为啥

liuan3756 avatar Oct 28 '19 10:10 liuan3756