ono
ono

Reputation: 3102

9-patch padding doesn't adjust correctly

Adding a 9-patch:

enter image description here

Seems ok here:

enter image description here

However, after adding android:padding="5dp", the padding doesn't just happen around the content. Also, the arrow stretches a bit. Is my 9-patch drawn incorrectly?

enter image description here

TextView:

enter image description here

Upvotes: 3

Views: 1988

Answers (1)

ono
ono

Reputation: 3102

This ended up doing it. I guess the adding the background 9-patch directly to the TextView doesn't work. Just wrap it in a FrameLayout

 <FrameLayout
        android:background="@drawable/notification_bg"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content">

        <TextView
            android:id="@+id/tv_number_left"
            android:padding="2dp"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:visibility="gone"/>

 </FrameLayout>

Upvotes: 1

Related Questions