I am creating a DialogFragment to show some help messages related to my application. Everything works just fine, except for one thing: there is a black bar at the top of the window that displays the Dialog dialog box, which I believe is reserved for a name that I don't want to use.
This is especially painful since my custom DialogFragment uses a white background, so the change is too infamous to be left out.
Let me show you this more graphically:

Now the XML code for my DialogFragment looks like this:
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent"> <LinearLayout android:id="@+id/holding" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@drawable/dialog_fragment_bg" > <LinearLayout android:id="@+id/confirmationToast" android:orientation="horizontal" android:layout_width="wrap_content" android:layout_height="wrap_content" > <TextView android:id="@+id/confirmationToastText" android:layout_width="wrap_content" android:layout_height="fill_parent" android:text="@string/help_dialog_fragment" android:textColor="#AE0000" android:gravity="center_vertical" /> </LinearLayout> <LinearLayout android:id="@+id/confirmationButtonLL" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="fill_parent" android:gravity="center_horizontal" > <Button android:id="@+id/confirmationDialogButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center" android:layout_marginBottom="60dp" android:background="@drawable/ok_button"> </Button> </LinearLayout> </LinearLayout> </ScrollView>
And the class code that implements DialogFragment:
public class HelpDialog extends DialogFragment { public HelpDialog() {
And the creation process in the main Office:
private void showHelpDialog() { android.support.v4.app.FragmentManager fm = getSupportFragmentManager(); HelpDialog helpDialog = new HelpDialog(); helpDialog.show(fm, "fragment_help"); }
I really don't know if this answer related to a dialog is suitable, Android: how to create a dialog without a title?
How can I get rid of this header area?
android android-dialogfragment
AlejandroVK Mar 07 '13 at 17:10 2013-03-07 17:10
source share