We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
ScrollView中包括ZrcListView,无法触发加载更多事件。 注:ScrollView中包含ListView height已重新计算,不知道是不是需要针对ZrcListView需要另外计算。 计算代码如下: private void setListViewHeightBasedOnChildren(ZrcListView listView) {
// 获取ListView对应的Adapter ListAdapter listAdapter = listView.getAdapter(); if (listAdapter == null) { return; } int totalHeight = 0; int tmp = 0; for (int i = 0, len = listAdapter.getCount(); i < len; i++) { // listAdapter.getCount()返回数据项的数目 View listItem = listAdapter.getView(i, null, listView); // 计算子项View 的宽高 listItem.measure(0, 0); // 统计所有子项的总高度 tmp = listItem.getMeasuredHeight(); totalHeight += tmp; } ViewGroup.LayoutParams params = listView.getLayoutParams(); // params.height = totalHeight+ (listView.getDividerHeight() * (listAdapter.getCount() - 1));
// totalHeight += tmp/2; params.height = totalHeight+ (listView.getDividerHeight() * (listAdapter.getCount() - 1)); // listView.getDividerHeight()获取子项间分隔符占用的高度 // params.height最后得到整个ListView完整显示需要的高度 listView.setLayoutParams(params);
sv = (ScrollView)root.findViewById(R.id.video_cover_scroll); sv.smoothScrollTo(0, 0); }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
ScrollView中包括ZrcListView,无法触发加载更多事件。
注:ScrollView中包含ListView height已重新计算,不知道是不是需要针对ZrcListView需要另外计算。
计算代码如下:
private void setListViewHeightBasedOnChildren(ZrcListView listView) {
// totalHeight += tmp/2;
params.height = totalHeight+ (listView.getDividerHeight() * (listAdapter.getCount() - 1));
// listView.getDividerHeight()获取子项间分隔符占用的高度
// params.height最后得到整个ListView完整显示需要的高度
listView.setLayoutParams(params);
The text was updated successfully, but these errors were encountered: