Closed mecobean closed 7 years ago
onAttachedToWindow 此前没有被回调
不解为何要在onAttachedToWindow中初始化:mHeadLayout,mExtraHeadLayout,mBottomLayout
看代码移到constructor也没问题吧
@sisel 因为在构造函数中初始化mHeadLayout,mExtraHeadLayout,mBottomLayout,可滑动View最后被inflate进来=getChildAt(3)。而在onAttachedToWindow方法中可滑动View始终为getChildAt(0)。目前已修改。
已修改?好像没看到commit,应该怎么避免这个bug呢?
@sisel 在构造函数中初始化mHeadLayout,mExtraHeadLayout,mBottomLayout,然后在onFinishInflate方法中获取到可滑动View:
@Override
protected void onFinishInflate() {
super.onFinishInflate();
//获得子控件
//TODO 可能引入新问题,fixedHeader显示异常
mChildView = getChildAt(3);
cp.init();
}
没有提交是因为引入了一点小问题
是不是可以改为在构造方法中创建,在onFinishInflate中add 这样就不存在次序问题
v1.06已修复,感谢反馈!