Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BouncingJellyView中onSizeChanged方法中的contentHeight为0 #1

Closed
xinnuo opened this issue Mar 5, 2018 · 4 comments
Closed

BouncingJellyView中onSizeChanged方法中的contentHeight为0 #1

xinnuo opened this issue Mar 5, 2018 · 4 comments
Labels

Comments

@xinnuo
Copy link

xinnuo commented Mar 5, 2018

BouncingJellyView类中onSizeChanged方法中获取可滚动的内容的高度contentHeight始终为0,判断方法没有用,当屏幕没有满屏时向上滑动,有明显的抖动现象。

@aohanyao
Copy link
Owner

aohanyao commented Mar 5, 2018

能否贴上你的代码?

@xinnuo
Copy link
Author

xinnuo commented Mar 5, 2018

没有代码啊,只在布局里用包了一层LinearLayout布局。只要屏幕没充满不能滑动的情况下上滑就有这种情况。
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
super.onSizeChanged(w, h, oldw, oldh);
int contentHeight = this.getChildAt(0).getHeight();
if(contentHeight > 0 && contentHeight <= ScreenUtils.getScreenHeight(this.getContext())) {
this.mBouncingType = 1;
}

}

这个方法的contentHeight高度就是0,你把demo的数据减少几条就可以试

@aohanyao
Copy link
Owner

aohanyao commented Mar 6, 2018

该问题已修复,可以查看一下最新版本。

@xinnuo
Copy link
Author

xinnuo commented Mar 6, 2018

ok

@aohanyao aohanyao added the bug label Mar 6, 2018
@aohanyao aohanyao closed this as completed Mar 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants