Android的可扩展列表视图儿童焦点 [英] Android Expandable List View Child Focus
本文介绍了Android的可扩展列表视图儿童焦点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在Android的可扩展列表视图团体和孩子都为文本视图,当我抚摸父组则表现出不同的状态集中,但孩子不显示此行为。我认为这是与焦点问题。任何建议。
解决方案
如果您使用的是自定义扩展列表适配器:
块引用>@燮pressLint(UseSparseArrays)
公共类MyExpandableListAdapter扩展BaseExpandableListAdapter { / *
....
* / @覆盖
公共布尔isChildSelectable(INT groupPosition,诠释childPosition){ 返回true; //这将是默认为false。
}
}I have an expandable List View in android with groups and child both as text views, When i touch parent group it is showing different focused states , BUT CHILD DOES NOT SHOW THIS BEHAVIOR. I think it is problem with focus. Any suggestions.
解决方案If you are using a Custom Expandable list Adapter:
@SuppressLint("UseSparseArrays") public class MyExpandableListAdapter extends BaseExpandableListAdapter { /* .... */ @Override public boolean isChildSelectable(int groupPosition, int childPosition) { return true; //this will be false by default. } }
这篇关于Android的可扩展列表视图儿童焦点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文