java - Apply 9-patch drawable to Button, keeping default padding -


i'm attempting customise of button using 9-patch drawable no padding defined within in (no pixels on right or bottom inside 9-patch editor).

is there simple way apply 9-patch drawable button , maintain button's default size. example, when apply 9-patch easy button shown below, different size other default styled buttons, share same layout, except 9-patch style.

mdpi layout:
mdpi layout

hdpi layout:
enter image description here

so basically, there way make easy button same size medium , hard, on both mdpi , hdpi screens, without making new 9-patch each density, , working out correct padding.

thanks in advance help, can provide more information if required.

well after more research seems isn't possible use 1 9-patch drawable screen densities.

the link below states need different drawables each density:

custom color buttons android

3.1. create images 9-patch images different colors need , put them drawable-hdpi , drawable-mdpi (yes, need 2 versions if want buttons on different devices).

if knows different though, appreciated.


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -