参考 ViewGroup 中的 generateDefaultLayoutParams()
protected LayoutParams generateDefaultLayoutParams() {
return new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
}默认是 wrap_content
本文介绍了在ViewGroup中如何通过generateDefaultLayoutParams()方法生成默认的布局参数。默认情况下,该方法返回LayoutParams.WRAP_CONTENT,这对于子视图的尺寸适应非常有用。
参考 ViewGroup 中的 generateDefaultLayoutParams()
protected LayoutParams generateDefaultLayoutParams() {
return new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
}

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