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

高度计算错误问题修复记录 #1

Open
goyourfly opened this issue Jun 26, 2019 · 0 comments
Open

高度计算错误问题修复记录 #1

goyourfly opened this issue Jun 26, 2019 · 0 comments

Comments

@goyourfly
Copy link
Owner

在 measure 时,为了修改 child 的高度,要通过修改 LayoutParams 的高度,但是每次 measure 的时候要先将 LayoutParams 恢复为初始状态,要不然计算就会错误,之前的做法是先获取所有子 View 的高度和,再恢复初始状态,在第一次 measure 时没啥问题,因为 LayoutParams 就是初始状态,但是如果再次触发 measure,这时获取 View 的高度和就是之前修改过的,导致计算错误,所以应该在 measure 最开始的地方恢复 LayoutParams 的状态
Fix measure bug

@goyourfly goyourfly changed the title 高度计算错误问题 高度计算错误问题修复记录 Jun 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant