Java 基于childposition在expandablelistview中隐藏子项
我需要在ExpandableListView中根据groupPosition和childPosition隐藏某些组的某些子级。但是在多次扩展组时(特别是当扩展组不在焦点中时),我得到的childPosition的值与以前不同。所以另一行被隐藏了。你知道我该如何每次都抓住合适的孩子吗 现在我设置了一个高度为0dp的不同布局,因为如果我将visibility设置为View.GONE,它会将行显示为空白Java 基于childposition在expandablelistview中隐藏子项,java,android,Java,Android,我需要在ExpandableListView中根据groupPosition和childPosition隐藏某些组的某些子级。但是在多次扩展组时(特别是当扩展组不在焦点中时),我得到的childPosition的值与以前不同。所以另一行被隐藏了。你知道我该如何每次都抓住合适的孩子吗 现在我设置了一个高度为0dp的不同布局,因为如果我将visibility设置为View.GONE,它会将行显示为空白 if (convertView == null) { if (((m_B
if (convertView == null) {
if (((m_Budget.budget_planTypeid.equals("budget_single")) || (m_Budget.budget_planTypeid.equals("budget_double")) // hide
// pets
|| (m_Budget.budget_planTypeid.equals("budget_singlefamily")) || (m_Budget.budget_planTypeid.equals("budget_doublefamily"))) && (groupPosition == 4)
&& (childPosition == 5)) {
convertView = inflater.inflate(R.layout.blankrow, parent, false);
} else if (((m_Budget.budget_planTypeid.equals("budget_single")) || (m_Budget.budget_planTypeid.equals("budget_double")) // hide
// child
// care
|| (m_Budget.budget_planTypeid.equals("budget_singlepet")) || (m_Budget.budget_planTypeid.equals("budget_doublepet"))) && (groupPosition == 3)
&& (childPosition == 6)) {
**convertView = inflater.inflate(R.layout.blankrow, parent, false);**
} else {
convertView = inflater.inflate(R.layout.budget_list_rowitem, parent, false);
}
粗体是空白行的布局。否则我会设置一个常规布局
请为适配器添加代码。添加了适配器的基本部分,我在其中设置了孩子的布局。仍然无法理解它