TextView 设置background(backgroundResource)后padding等属性无效
TextView txt_code=(TextView)findViewById(R.id.txt_code);
int pad = txt_code.getPaddingTop();
txt_code.setBackgroundResource(R.drawable.button_layer_gray);
txt_code.setPadding(pad, pad, pad, pad);
setPadding要在setBackgroundResource之后, 并且padding的值要在setBackgroundResource之前获取到