Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to remove the border frame a dialogframe
    primarykey
    data
    text
    <p>This question has been answered for a <code>Dialog</code> to my knowledg not for a <code>DialogFrame</code>.</p> <p>I would like to remove the border shown in this picture. Sorry no pictures allowed.</p> <p>This is my code:</p> <pre><code>public class SettingDialogFragment extends DialogFragment { public SettingDialogFragment() { // constructor } public Dialog onCreateDialog(Bundle savedInstanceState) { ContextThemeWrapper context = new ContextThemeWrapper(getActivity(), 0); context.setTheme(R.style.dialog); AlertDialog.Builder alertDlgBldr = new AlertDialog.Builder(getActivity()); LayoutInflater inflater = getActivity().getLayoutInflater(); alertDlgBldr.setView(inflater.inflate(R.layout.dialog_theme, null)); return alertDlgBldr.create(); } } </code></pre> <p>This is the <strong>layout</strong>:</p> <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content"&gt; &lt;TextView android:id="@+id/dialog_title" style="@style/title" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_alignParentTop="true" android:layout_centerHorizontal="true" android:text="@string/dialog_theme_title" android:textAppearance="?android:attr/textAppearanceLarge" android:textColor="@color/logo_color" android:textStyle="bold" /&gt; &lt;TextView android:id="@+id/dialog_text" style="@style/body" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignLeft="@id/dialog_text" android:layout_below="@id/dialog_title" android:text="Demonstation how to use vector drawables to style a dialog box" android:textAppearance="?android:attr/textAppearanceSmall" android:textColor="@color/logo_color" /&gt; &lt;ImageView android:id="@+id/dialog_image" android:layout_width="150dp" android:layout_height="150dp" android:layout_below="@id/dialog_text" android:layout_centerHorizontal="true" android:src="@drawable/cats_dogs" /&gt; &lt;/RelativeLayout&gt; </code></pre> <p>This is the <strong>style</strong></p> <pre><code>&lt;style name="dialog"&gt; &lt;!-- title encapsulating main part (backgroud) of custom alertdialog --&gt; &lt;item name="android:windowFrame"&gt;@null&lt;/item&gt; &lt;!-- turn off any drawable used to draw a frame on the window --&gt; &lt;item name="android:windowBackground"&gt;@drawable/dialog_background&lt;/item&gt; &lt;!-- turn off any drawable used to draw a frame on the window --&gt; &lt;item name="android:windowIsFloating"&gt;true&lt;/item&gt; &lt;!-- float the window so it does not fill the screen --&gt; &lt;item name="android:windowNoTitle"&gt;true&lt;/item&gt; &lt;!-- remove the title bar we make our own--&gt; &lt;item name="android:windowContentOverlay"&gt;@null&lt;/item&gt; &lt;!-- remove the shadow from under the title bar --&gt; &lt;/style&gt; </code></pre> <p>This the <strong>drawable</strong></p> <pre><code>&lt;shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" &gt; &lt;solid android:color="#00000000"/&gt; &lt;corners android:radius="10dp"/&gt; &lt;stroke android:color="#FFF000" android:width="3dp" /&gt; &lt;/shape&gt; </code></pre> <p>I think I tried every trick in the book now. Searched Stackoverflow for three days now, but most answers relate to <code>Dialog</code> not <code>DialogFragment</code>. Please help me out</p> <hr> <p>This code resolved the problem, finally!</p> <pre><code>public class SettingDialogFragment extends DialogFragment { public SettingDialogFragment() { // this empty constructor without any parameter is required by Android // to in order to instantiate the fragment when it needs to do so. } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setStyle(STYLE_NORMAL, android.R.style.Theme_Light_Panel); } @Override public Dialog onCreateDialog(Bundle savedInstanceState) { return super.onCreateDialog(savedInstanceState); } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.dialog_theme, container, false); return view; } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload