Why do 9-patch graphics size correctly in the emulator but not on a phone?

前端 未结 1 728
小鲜肉
小鲜肉 2020-12-06 06:52

I have a RelativeLayout that has a 9-patch background image. The image is a simple speech bubble with a perfectly centered \"arrow\" at the bottom middle.

相关标签:
1条回答
  • 2020-12-06 07:37

    Make sure you have an mdpi and an hdpi version if you test on different densities. If you put your 9patch in res/drawable/ for instance, it will be treated as an mdpi asset and scaled up automatically on hdpi devices (Nexus S). Because it's an automatic process, the results are not guaranteed.

    0 讨论(0)
提交回复
热议问题