9-patch not working in ICS
-
28-10-2019 - |
Question
I have a 9-patch file that works fine in Android v2.2 but when I run the app on the ICS emulator, it defaults to stretch scale. Check out these screen shots:
Anyone run into this problem before?
Solution
Not sure if this is helpful or not, but I saw a similar issue once with 2.3.3. I just did a clean in Eclipse and rebuilt the app. After that, the 9-patch drew the correct way.
OTHER TIPS
ICS is a little pickier about 9-patches due to the new hardware-accelerated rendering pipeline. In particular, if the incompressible parts of the patch are larger than the region in which you're trying to draw it, weird things can happen.
Can you supply the .9.png you're using in this example?
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow