Search code examples
androidnine-patch

Ugly nine-patches, not scaling right


A made some nine-patches for my buttons in Android but they scale in an ulgy way. The weird thing is that they are only ugly in one specific Android project.

enter image description here

I have no idea what cause the nine-patch to scale bad. This is the XML used in the badly scaled project, it is the same in the good scaled project.

<Button
    android:id="@+id/issueShare"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_weight="1"
    android:layout_marginLeft="5sp"
    android:layout_marginRight="5sp"
    android:background="@drawable/button"
    android:text="Delen" />

Solution

  • I found the solution on a place I would never look. The problem was that in my Android Manifest I didn't specify the android:targetSdkVersion, only the minSdkVersion. After setting the android:targetSdkVersion the nine-patches scaled fine.