android - Incorrect stretching of simple 9-patch image to get 1px border on high-res devices -


i want simple 1px border white background 9-patch view in android application. works fine on samsung galaxy tab 730, suprise, result on samsung nexus 10 different:

desired result (1px blue border , white background): info window 9-patch background correctly displayed.

actual result (1px blue border , light blue background): info window 9-patch background , blue background (incorrectly stretched)

the used 9-patch simple: used 9-patch image, enlarged: enter image description here

two solutions found worked me:

  • dirty hack: replacing image following bigger image (that not affected rescaling on larger screen device, might affected on larger displays): 9-patch 1px border 3x3px white , enlarged enter image description here
  • correct solution: moving 9-patch image folder res/drawable-nodpi (see 9patch stretching areas didn't mark) prevent being rescaled on devices.

Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -