ListView 中嵌套GridView listview item 不能点击问题

在ListView的item中有GridView,抢占焦点的情况,解决办法步骤如下:
            (1)  现在ListView的Item的最外面的LinearLayout中设置:、
                        android:descendantFocusability="blacksDescendants"
             (2)  再在gridview的getView()方法中设置:
                        gridview.setClickable(false);
                        gridview.setPressed(false);
                        gridview.setEnabled(false);
                        即就可以相应OnItemLongClickListener()这个方法了。

猜你喜欢

转载自tonyking2010.iteye.com/blog/2191908