扩展列表指示器指示器、列表

由网友(╭陌殇ゞ)分享简介:我有一个扩展列表于是两个分别的问题(我见过索姆类似的问题但从来没有找到答案)我如何隐藏的箭头(组指标)当有没有孩子我试图做到这一点的适配器公开查看getGroupView(INT groupPosition,布尔isExpanded,查看convertView,ViewGroup中父){如果(getChildr...

我有一个扩展列表

于是两个分别的问题

(我见过索姆类似的问题 但从来没有找到答案)我如何 隐藏的箭头(组指标) 当有没有孩子

我试图做到这一点的适配器

 公开查看getGroupView(INT groupPosition,布尔isExpanded,查看convertView,ViewGroup中父){
如果(getChildrenCount(groupPosition)== 0){
      //我如何隐藏组指标呢?
}
 

但我坚持那么,怎样才能修改 组指标为空基?

如何有不同的行为时, 你上的箭头点击(扩大 组)与你点击的标题 组(去一个活动)

解决方案 您必须设置一个 GroupIndicator 绘制具有不同的状态。请查看 StateListDrawable ,也许是因为state_empty指定空可绘制。

I have an expandable list

优质水流指示器 铜制水流指示器水油指示器 泰兴油表指示器

so two question

(I've seen somme similar question but never found the answer) How do I hide the arrow ( group indicator) when there's no children

I tried to do it in the adapter

public View getGroupView(int groupPosition, boolean isExpanded, View convertView,ViewGroup parent) {
if(getChildrenCount(groupPosition)==0) {
      // how do i hide the group indicator ?
}

But I'm stuck So, how can modify the group indicator for empty groups ?

How to have different behavior when you click on the arrow (expands the group) vs you click on the title of the group (go to an activity)

解决方案

You have to set a GroupIndicator drawable with different states. Check out StateListDrawable, maybe for the "state_empty" specify a null drawable.

阅读全文

相关推荐

最新文章