有时候直接设置background图片会变形
private Button btn;
btn= (Button)findViewById(R.id.btn);
Drawable drawable =ContextCompat.getDrawable(this,R.mipmap.test);
drawable.setBounds(0, 0,drawable.getMinimumWidth() ,drawable.getMinimumHeight()); //此为必须写的
btn.setCompoundDrawables(drawable, null, null, null);