只是一個簡單的問題,不知道如何去做。有誰知道如何/如果這可以做到?有沒有辦法讓自定義對話框的標題部分不可見?
原因:我只想要一個沒有分區的固體對話框,因爲它在我的應用程序中看起來好一點。
編輯
public void showCustomDialog() {
Dialog dialog = new Dialog(this);
dialog.setContentView(R.layout.customdialog);
TextView thisText = (TextView) dialog.findViewById(R.id.customDialogThisText);
thisText.setText("This");
TextView thatText = (TextView) dialog.findViewById(R.id.customDialogThatText);
thatText.setText("That");
ImageView image = (ImageView) dialog.findViewById(R.id.customDialogImageView);
image.setImageResource(R.drawable.icon);
//Crashes the program with an AndroidRuntimeError
//dialog.requestWindowFeature(dialog.getWindow().FEATURE_NO_TITLE);
dialog.show();
}
然後它彈出一個空白標題框。任何其他想法? – NotACleverMan 2010-10-22 13:55:49
然後告訴我們你是如何打電話給你的對話框的。默認情況下,它不應該有標題部分 – Falmarri 2010-10-22 17:29:23
您是否能夠顯示任何示例代碼,瞭解如何創建顯示的對話框?我一直在使用這個帖子的代碼:http://stackoverflow.com/questions/2644134/android-how-to-create-a-dialog-without-a-title,我還沒有能夠做到這一點。我將編輯我的OP來顯示我的代碼。 – NotACleverMan 2010-10-25 15:49:19