本文整理了Java中android.widget.ExpandableListView.getDividerHeight()
方法的一些代码示例,展示了ExpandableListView.getDividerHeight()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ExpandableListView.getDividerHeight()
方法的具体详情如下:
包路径:android.widget.ExpandableListView
类名称:ExpandableListView
方法名:getDividerHeight
暂无
代码示例来源:origin: stackoverflow.com
int height = totalHeight + expandableListView.getDividerHeight() * (adapter.getGroupCount() - 1);
代码示例来源:origin: stackoverflow.com
height += list.getDividerHeight() * (list.getCount() - 1);
Log.i("height", "" + height);
return height;
代码示例来源:origin: stackoverflow.com
params.height = totalHeight + (listView.getDividerHeight() * (listAdapter.getGroupCount() - 1));
listView.setLayoutParams(params);
listView.requestLayout();
代码示例来源:origin: stackoverflow.com
private void setListViewHeight(ExpandableListView listView) {
ExpandableListAdapter listAdapter = (ExpandableListAdapter) listView.getExpandableListAdapter();
int totalHeight = 0;
for (int i = 0; i < listAdapter.getGroupCount(); i++) {
View groupView = listAdapter.getGroupView(i, true, null, listView);
groupView.measure(0, View.MeasureSpec.UNSPECIFIED);
totalHeight += groupView.getMeasuredHeight();
if (listView.isGroupExpanded(i)){
for(int j = 0; j < listAdapter.getChildrenCount(i); j++){
View listItem = listAdapter.getChildView(i, j, false, null, listView);
listItem.measure(0, View.MeasureSpec.UNSPECIFIED);
totalHeight += listItem.getMeasuredHeight();
}
}
}
ViewGroup.LayoutParams params = listView.getLayoutParams();
params.height = totalHeight
+ (listView.getDividerHeight() * (listAdapter.getGroupCount() - 1));
listView.setLayoutParams(params);
listView.requestLayout();
}
代码示例来源:origin: stackoverflow.com
private void setExpandableListViewHeightBasedOnChildren(ExpandableListView expandableListView, Integer expandedGroupPosition) {
ExpandableListAdapter expandableListAdapter = expandableListView.getExpandableListAdapter();
if (expandableListAdapter == null) {
return;
}
int totalHeight = 0;
int totalDividerHeight = 0;
for (int i = 0; i < expandableListAdapter.getGroupCount(); i++) {
View groupItem = expandableListAdapter.getGroupView(i, expandedGroupPosition != null, null, expandableListView);
totalHeight += Utils.convertDpToPixel(92.42f, this);
if(expandedGroupPosition != null && expandedGroupPosition.equals(i)) {
for(int j=0;j<expandableListAdapter.getChildrenCount(i);j++) {
View childItem = expandableListAdapter.getChildView(i, j, j+1==expandableListAdapter.getChildrenCount(i), null, expandableListView);
totalHeight += Utils.convertDpToPixel(92.42f, this);
}
totalDividerHeight += expandableListView.getDividerHeight() * (expandableListAdapter.getChildrenCount(i)-1);
}
}
totalDividerHeight += expandableListView.getDividerHeight() * (expandableListAdapter.getGroupCount()-1);
ViewGroup.LayoutParams params = expandableListView.getLayoutParams();
params.height = totalHeight + totalDividerHeight;
expandableListView.setLayoutParams(params);
expandableListView.requestLayout();
}
代码示例来源:origin: stackoverflow.com
+ (listView.getDividerHeight() * (listAdapter.getGroupCount() - 1));
if (height < 10)
height = 200;
代码示例来源:origin: stackoverflow.com
+ (listView.getDividerHeight() * (listAdapter.getGroupCount() - 1));
if (height < 10)
height = 200;
代码示例来源:origin: stackoverflow.com
+ (listView.getDividerHeight() * (listAdapter.getGroupCount() - 1));
if (height < 10)
height = 200;
代码示例来源:origin: doc-rj/smartcard-reader
dummyView.setDivider(listView.getDivider(), parent.getMeasuredWidth(), listView.getDividerHeight());
代码示例来源:origin: stackoverflow.com
dummyView.setDivider(listView.getDivider(), parent.getMeasuredWidth(), listView.getDividerHeight());
代码示例来源:origin: lucid-lynxz/BlogSamples
dummyView.setDivider(listView.getDivider(), parent.getMeasuredWidth(), listView.getDividerHeight());
内容来源于网络,如有侵权,请联系作者删除!