Search code examples
androidnine-patchnexus-5

9 patch issue with nexus 5


I have a 9 patch image, here it is 9 patch image

now, I'm using it as a background image for a Relative Layout like this

<RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="@drawable/ae_bubble">

    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:padding="8dp"
        android:text="How satisfied are you in terms of Aeroman performance regarding: TAT, quality of the work performed and aircraft appearance?"/>

</RelativeLayout>

This give me the next result in android studio preview using a nexus 5 preview, perfect in the center

android studio preview

but when I run it in a nexus 5 emulator the tip of the arrow is not centered, same for the real nexus 5 device

enter image description here

I have tried this on another device like a moto g emulator and the real moto g device and the tip is perfect in the center, what can be wrong on the image bubble that is affecting only nexus 5?, also is weird that the nexus 5 preview on android studio is centered, what can I do?, thanks for any help

FIX This is the final image that worked

enter image description here


Solution

  • Just checked your image and you should change the two dots place. Right now they are in the same postion with the last pixels of the bottom line. Try move them one pixel other for each side.