The Android user dialog shows the Android title bar.

I made an xml file as follows:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="bottom" android:layout_gravity="bottom" android:background="#04600F" android:padding="10dp"> <TextView android:id="@+id/txtMessage" android:layout_width="fill_parent" android:gravity="center" android:layout_height="wrap_content"/> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content"> <Button android:id="@+id/btnOne" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textSize="20dip" android:textColor="#ffffff" android:layout_alignParentLeft="true" android:background="@drawable/black_menu_button" android:layout_marginLeft="5dip" android:layout_centerVertical="true" android:layout_centerHorizontal="true"/> <Button android:id="@+id/btnTwo" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textSize="20dip" android:textColor="#ffffff" android:layout_alignParentRight="true" android:background="@drawable/blue_menu_button" android:layout_marginRight="5dip" android:layout_centerVertical="true" android:layout_centerHorizontal="true"/> </RelativeLayout> </LinearLayout> 

And I'm trying to access it like this:

  final Dialog dialog = new Dialog(ctx,android.R.style.Theme_Translucent_NoTitleBar_Fullscreen); dialog.setContentView(R.layout.myxml); ..... 

He looks at the screen exactly as I want it, at the bottom of it. My application has the following suite on AndroidManifest:

 android:theme="@android:style/Theme.NoTitleBar.Fullscreen" 

The only digression from what I did is the fact that the Android title bar (the one that has the battery / signal ...) becomes visible while my dialog is displayed. How to disable it?

Next edit

Thank you for pointing out that the solution was pretty simple for me.

 dialog.requestWindowFeature(Window.FEATURE_NO_TITLE); 
+6
android dialog titlebar
source share
1 answer

The solution was very simple, try the code below:

 final Dialog dialog = new Dialog(ctx,android.R.style.Theme_Translucent_NoTitleBar_Fullscreen); dialog.requestWindowFeature(Window.FEATURE_NO_TITLE); dialog.setContentView(R.layout.myxml); 
+17
source share

All Articles