ViewGroup.LayoutParams params = new ViewGroup.LayoutParams(40, 80); myButton.setLayoutParams(params);