btn1 = (Button) findViewById(R.id.button1);
btn2 = (Button) findViewById(R.id.button2);
btn2.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
btn1.layout(100, 100, 300, 300);
//容器左上为0,0
// L 控件左边离容器左边的距离
// T 控件顶部离容器顶部的距离
// R 控件右边离容器左边的距离
// B 控件底部离容器顶部的距离
}
});
android中的layout 函数
最新推荐文章于 2022-09-06 22:18:41 发布