`
407827531
  • 浏览: 1060783 次
  • 性别: Icon_minigender_1
  • 来自: 厦门
社区版块
存档分类
最新评论

自定义对话框

 
阅读更多

推荐安卓开发神器(里面有各种UI特效和android代码库实例)

LayoutInflater factory = LayoutInflater.from(Test.this);  
        final View textEntryView = factory.inflate(R.layout.test, null);  
        AlertDialog dlg = new AlertDialog.Builder(Test.this)  
        .setTitle("Input password")  
        .setView(textEntryView)  
        .setPositiveButton("OK", new DialogInterface.OnClickListener() {  
            public void onClick(DialogInterface dialog, int whichButton) {  
                EditText etPassword = (EditText)textEntryView.findViewById(R.id.et_name);   
            }       
        })  
        .setNegativeButton("Cancel", new DialogInterface.OnClickListener() {  
            public void onClick(DialogInterface dialog, int whichButton) {  
                //finish();  
            }  
        })  
        .create();  
        dlg.show();

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics