android - custom image layout border in dialog -


this question has answer here:

in app have situation: open dialog , set content view this:

dialog dialog = new dialog(context); dialog.setcontentview(r.layout.dialog); 

dialog.xml

<?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android"     android:layout_width="match_parent"     android:layout_height="match_parent"     android:background="@drawable/patientsbg"     android:orientation="vertical" > </linearlayout> 

and result this:

enter image description here

i want have dialog image , no borders , spaces. idea ?

just set dialog background transparent below:

dialog dialog = new dialog(context); dialog.setcontentview(r.layout.dialog);  dialog.getwindow().setbackgrounddrawable(new colordrawable(android.graphics.color.transparent)); 

or

try apply theme dialog remove border of dialog below:

create style in res/style , write below code in it.

<style name="dialog_no_border">     <item name="android:windowisfloating">true</item>     <item name="android:windowbackground">#00000000</item> </style> 

and set above style in dialog below:

 dialog = new dialog(this, r.style.dialog_no_border); 

Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -