📌  相关文章
📜  以编程方式设置布局的高度 android - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:30.354000             🧑  作者: Mango

代码示例1
// Gets linearlayout
LinearLayout layout = findViewById(R.id.numberPadLayout);
// Gets the layout params that will allow you to resize the layout
LayoutParams params = layout.getLayoutParams();
// Changes the height and width to the specified *pixels*
params.height = 100;
params.width = 100;
layout.setLayoutParams(params);