Issue with image having transparent background in Android -


i'm creating custom dialog background image has rounded corners. remove white border using custom style, it's displayed if black rectangle of same size behind image, shown below (the background image of dialog brown one):

enter image description here

how can keep transparent background of image round corners?


layout of dialog:

<linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/confirmation" android:orientation="vertical" android:background="@drawable/dialog_background" android:layout_width="279dp" android:layout_height="130dp"    > ... 

i remove white border applying following style dialog:

<style name="theme_dialog_translucent" parent="android:theme.dialog"> <item name="android:windowbackground">@null</item> </style> 

my customdialog class is:

public class customdialog extends dialog implements onclicklistener { button okbutton;  public customdialog(context context) {     // custom style remove dialog border - corners black though :(     super(context, r.style.theme_dialog_translucent);     // 'window.feature_no_title' - used hide title     requestwindowfeature(window.feature_no_title);           setcontentview(r.layout.custom_dialog);     okbutton = (button) findviewbyid(r.id.button_ok);     okbutton.setonclicklistener(this); }  ...  } 

the problem in windowbackground attribute try using this

<item name="android:windowbackground">#00000000</item> 

this make window background transparent.

i hope solves issue


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -