Search code examples
android-layoutandroid-notificationsnine-patch

Android 9patch opaque corners


I show notifications using android 9patch image:

enter image description here

I tried to use white and transparent background, but it's still opaque. And yes, the name of file ends with .9.png

Here is the layout of notification:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:layout_gravity="center_horizontal">

        <TextView
                android:id="@android:id/message"
                android:layout_width="300dip"
                android:layout_height="wrap_content"
                android:layout_margin="@dimen/common_whitespace"
                android:textColor="@color/screen_game_dialog_text_color"
                android:textSize="14dip"
                android:gravity="center"
                android:background="@drawable/notification_popup_default"
                android:contentDescription="@null"/>

</LinearLayout>

Here is 9patch image (it's not mine, so I've added a sort of watermark):

enter image description here

What am I doing wrong?


Solution

  • Background of corners is white, alpha value is not 0. Background has to be completely transparent.