전체 화면 경고 대화 상자를 만들려고했습니다. 그러나 나는 이것을 얻었습니다 ScreenShot. 화면을 가득 채울 수 있도록 도와주세요. 나는 많은 질문을 읽었지 만, 나는이 문제를 해결할 수 없었다.전체 화면 alertDialog 만들기
// 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>
감사
여기 내 코드입니다. 이 도움이
@Override
public void onStart() {
super.onStart();
int height = (int)(getResources().getDisplayMetrics().heightPixels);
int width = (int)(getResources().getDisplayMetrics().widthPixels);
getDialog().getWindow().setLayout(width, height);
}
희망 : 당신이 할 수있는 일
시도를 : 그 V는 레이아웃)입니다. 이것이 작동하지 않으면 bmneu로 설정하십시오. –
내 레이아웃 여백이 0입니다. bmenu를 설정하는 방법? –
help_archive 레이아웃 파일의 값은 무엇입니까 – andre3wap