android - custom image layout border in dialog -
this question has answer here:
- dialog transparent background in android 14 answers
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:
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
Post a Comment