android自定义对话框
上一篇 /
下一篇 2013-09-03 20:54:52
/ 个人分类:step by step android测试
//*******************************
/* Button button=(Button)findViewById(R.id.alert);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {*/
new AlertDialog.Builder(TabmyActivity.this).setTitle("填写日期").setView(getLayoutInflater()
.inflate(R.layout.dialog_alert,(ViewGroup)findViewById(R.id.dialog_my)))
.setPositiveButton("确定", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
Toast.makeText(getApplicationContext(),"表明可以做其他操作哦",Toast.LENGTH_LONG).show();
}
})
.setNegativeButton("取消", null).show();
/* }*/
/* });*/
//*******************************
R.layout.dialog_alert中描述了自定义对话框的布局,R.id.dialog_my为布局中定义的对话框的id
收藏
举报
TAG: