【发布时间】:2016-02-07 15:13:30
【问题描述】:
如果我有 ImageView foo 我可以在将其添加到布局之前修改其参数:
RelativeLayout.LayoutParams testParams = new RelativeLayout.LayoutParams(500,500);
foo.setLayoutParams(testParams);
然后我将foo 添加到布局中:
exampleLayout.addView(foo);
在布局中添加foo后如何修改参数? (我读到如果foo 已经添加到布局中,会有不同的过程)
【问题讨论】:
-
添加视图后做同样的事情并调用 foo.invalidate();
标签: android android-layout imageview layoutparams