我试图做一个全屏警报对话框。但我已经得到这个ScreenShot。请帮助我改进它,完全填满屏幕。我已经阅读了很多问题,但是我无法解决这个问题。制作全屏警告对话框
这里是我的代码:
// AlertDialog Builder
AlertDialog.Builder bmneu = new AlertDialog.Builder(this, android.R.style.Theme_Translucent_NoTitleBar_Fullscreen);
// Inflate
LayoutInflater inflate = this.getLayoutInflater();
// View
View v = inflate.inflate(R.layout.help_archive, null);
// Assign view to AlertDialogBuilder
bmneu.setView(v);
// Alert Dialog
AlertDialog alertHelp = bmneu.create();
// Show AlertDialog
alertHelp.show();
XML代码(help_archive.xml):
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/scrollView1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#40e9e2f7" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TextView
android:id="@+id/txtHelpArchive1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="در این قسمت بایگانی از موارد خمسی ذخیره شده را مشاهده می کنید."
android:gravity="right"
android:padding="10dp"
android:textColor="#ffffff"
android:background="@android:color/transparent" />
<ImageView
android:id="@+id/imgHelpArchive1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:src="@drawable/help_archive1"
android:padding="10dp" />
<TextView
android:id="@+id/txtArchive2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="تاریخ سال خمسی با مشخص بودن، شمسی و یا قمری بودن سال، مشخص شده است. در سمت چپ تصویر نیز برای حذف، تعبیه شده است."
android:gravity="right"
android:padding="10dp"
android:textColor="#ffffff"
android:background="@android:color/transparent" />
<ImageView
android:id="@+id/imgHelpArchive2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:src="@drawable/help_archive2"
android:padding="10dp" />
<TextView
android:id="@+id/txtHelpArchive3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="با فشردن کلیدهای زیر می توانید، می توانید مواردی را که قبلا ذخیره کرده اید، مشاهده و یا ارسال کنید."
android:gravity="right"
android:padding="10dp"
android:textColor="#ffffff"
android:background="@android:color/transparent" />
<ImageView
android:id="@+id/imgHelpArchive3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:src="@drawable/help_archive3"
android:padding="10dp" />
</LinearLayout>
</ScrollView>
感谢。
尽量把marginTop /底部到零布局'help_archive'。如果这不起作用,然后尝试设置为bmneu。 –
在我的布局边距为零。如何设置bmenu? –
help_archive布局文件中的值是什么 – andre3wap