安卓编程如何在Java代码里设置button的margin(外边距)?javalayout
安卓编程如何在Java代码里设置button的margin(外边距)?2、在LayoutParams中设置margin
安卓编程如何在Java代码里设置button的margin(外边距)?
1、获取按钮的LayoutParams
LinearLayout.LayoutParams layoutParams = (LinearLayout.LayoutParams)button.getLayoutParams();2、在LayoutParams中设置margin
0