A MarginLayoutParams Error

A MarginLayoutParams Error


Code:

ViewGroup.MarginLayoutParams lp = new ViewGroup.MarginLayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);

Error:

should pass resolved pixel dimension instead of resource id here:getResource().getDimession*(ViewGroup.LayoutParams.WRAP_CONTENT)

MATCH_PARENTWRAP_CONTENT 其实是 MarginLayoutParams 构造函数的合法参数. 按Alt + Enter忽略代码检测即可。

I Don't Want Your Money, I Want Aragaki Yui.