0
我正在嘗試創建一個dialog
框,其中包含標題,正文(消息),正確選項。關於自定義對話框
我怎樣才能將它們逐行分開(我的意思是將它們分成三部分)?
這是我使用的代碼:的對話框
public void dialog_vhe(View view){
String button_details;
button_details = ((Button) view).getText().toString();
AlertDialog.Builder builder2 = new AlertDialog.Builder(this);
builder2.setMessage(" You can use either your garnt number or TRN.\n" +
" The Visa Grant Number can be found on your visa grant notification.\n " +
" The Transaction Reference Number can be found in your ImmiAccount and on any correspondence from the department. ")
.setCancelable(false)
.setNegativeButton("Ok", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.cancel();
}
});
AlertDialog alert2 = builder2.create();
alert2.setTitle("REFERENCE NUMBER");
alert2.show();
setContentView(R.layout.activity_visa_holder_enquiry);
}
你使用自定義警告對話框膨脹呢? –
創建自定義佈局,並在活動它充氣 –
創建於String.xml一個字符串,我也做了同樣的事情,像下面 <字符串名稱=「pasword_error」>密碼必須包含:\ n \ NAT至少一個大寫英文字母\ n \ n至少一個小寫英文字母\ n \ n至少一位數,\ n \ n至少一個特殊字符(!「#$%&'()* +, - 。/:; > = <?@^_'{|}〜)\ n \ n長度最小8位 –