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位 –