Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Replace 9patch background with padding
NinePatchDrawable bg = (NinePatchDrawable) getResources().getDrawable(R.drawable.button_new_light);
int pL = btnLike.getPaddingLeft();
int pR = btnLike.getPaddingRight();
int pT = btnLike.getPaddingTop();
int pB = btnLike.getPaddingBottom();
if(Build.VERSION.SDK_INT >= 16) {
} else {
btnLike.setPadding(pL, pT, pR, pB);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment