Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在创建自定义ViewGroup,我onLayout在其中使用我调用的方法addViewInLayout(),ViewGroup但它是View水平添加唯一的。
ViewGroup
onLayout
addViewInLayout()
View
如何强制它像AndroidView一样垂直添加ListView
ListView
寻求帮助。
您可以尝试通过指定位置
child.layout(int left, int top, int right, int bottom)
如果您已经测量了视图组中的其他视图,那么您应该能够获得最底部视图的底部
child.layout(left, viewAbove.getBottom(),right, viewAbove.getBottom()+heightOfTheChild);