W/View: requestLayout() improperly called by 布局GridView,一直疯狂刷新日志,导致item条目点击无效

报错:

requestLayout() improperly called by android.widget.GridView{} during second layout pass: posting in next frame

requestLayout() improperly called by android.widget.GridView{} during layout: running second layout pass

解决方法:

不让GridView获取焦点就行了。gridView.setFocusable(false)。

真是感谢大佬,这个bug简直恶心,恶心心!!!!!!!

改了半天。。。网上说的GridView   gv

用以下改法,是有道理的,可能别人能用,不过我无效

gv.setVisibility(View.GONE);
gv.setVisibility(View.VISIBLE);

我看了一下log  W/View: requestLayout() improperly called by android.widget.GridView

就是获取焦点的问题,我删了几个无用的控件,还是没用,最终用开头的办法解决了。如果还有别的情况用的别的方法,也可以分享下哦~

谢谢大家,头发可以减少脱落又,开森~

 

 


原文:https://blog.csdn.net/zhl101020/article/details/78327577 
 

你可能感兴趣的:(Android)