草庐IT

getChildView

全部标签

android - ExpandableListAdapter.getChildView() 与 AbsListView.LayoutParams 的交互

我正在研究BaseExpandableListAdapter的扩展,并具有以下getChildView()的实现:publicViewgetChildView(intgroupPosition,intchildPosition,booleanisLastChild,ViewconvertView,ViewGroupparent){AbsListView.LayoutParamslp=newAbsListView.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT,48);RelativeLayoutlayout=newRelativeLayo

android - 从 ExpandableListView 的 getChildView() 访问 groupview 的 TextView

我正在尝试访问GroupView的TextView,它显示了ChildView中所选复选框的计数。例如-North是GroupView,下面带有复选框的列表是ChildView。我想在每次单击复选框时更新计数(18)。我在复选框上应用了OnClickListner。我有自定义的ExpanadableListViewAdapterextendsBaseExpandableListAdapter。这是我的代码fragment-@OverridepublicViewgetGroupView(intgroupPosition,booleanisExpanded,ViewconvertView,

android - getChildView 未被调用

我正在制作一个包含自定义ExpandableListView适配器的菜单。尽管试图使我的代码尽可能接近API示例和我在网上看到的任何其他示例(包括多个密切相关的SO问题),但我仍然无法让它工作。我知道正在使用适配器,因为正在显示组View(由xml制作)。单击组项也会调用“getGroupView”,但代码永远不会运行“getChildView”、“getChild”或“getChildId”。我什至查看了Android-15源代码以找出我可能做错了什么,但没有发现任何奇怪的地方。=基本ActivitypublicclassSettingsMextendsFragmentActivit

android - 在什么条件下在 ExpandableListAdapter 中调用 getChildView()

在我的应用程序中,ExpandableListAdapter中的getChildView()没有被调用,而适配器返回正确的子计数(当getChildrenCount()被调用)。我的问题是;要让ExpandableListAdapter扩充其子级,需要满足哪些条件? 最佳答案 当您在组中和子项中有超过1个项目时调用,我的意思是当getGroupCount返回大于0的值时 关于android-在什么条件下在ExpandableListAdapter中调用getChildView(),我们在

notifyDataSetChanged 后未调用 android getChildView

我有一个expandableListView并试图像那样改变它的child:((SubItem)adapter.getChild(i+1,5)).setCount(unreadBox);adapter.notifyDataSetChanged();这是我的适配器类:publicclassDrawerAdapterextendsBaseExpandableListAdapter{privateContextcontext;privateListitems;privateList>subItems;publicDrawerAdapter(Contextcontext,Listitems,L