在DraggableGridView里面的这一句代码
getChildAt(i).layout(xy.x, xy.y, xy.x + childSize, xy.y + childSize);
的前面加上一句
getChildAt(i).measure(MeasureSpec.makeMeasureSpec(childSize, MeasureSpec.EXACTLY), MeasureSpec.makeMeasureSpec(childSize, MeasureSpec.EXACTLY));
附上链接
http://stackoverflow.com/questions/13699426/imageview-and-textview-not-displaying-in-view
还有另一种解决方案
http://stackoverflow.com/questions/18002475/inflated-layouts-children-not-showing
getChildAt(i).layout(xy.x, xy.y, xy.x + childSize, xy.y + childSize);
的前面加上一句
getChildAt(i).measure(MeasureSpec.makeMeasureSpec(childSize, MeasureSpec.EXACTLY), MeasureSpec.makeMeasureSpec(childSize, MeasureSpec.EXACTLY));
附上链接
http://stackoverflow.com/questions/13699426/imageview-and-textview-not-displaying-in-view
还有另一种解决方案
http://stackoverflow.com/questions/18002475/inflated-layouts-children-not-showing
本文解决在DraggableGridView中,使用getChildAt(i)方法获取子视图并调整其布局位置时,导致ImageView和TextView未正确显示的问题。通过在调用layout方法前,为子视图设置measure方法,确保视图大小被正确计算,从而解决布局显示不全的问题。同时,提供了两个相关链接,进一步解释和演示了解决方案。
1万+

被折叠的 条评论
为什么被折叠?



