三、常用控件的使用

一、AlertDialog

AlertDialog.Builder builder =new AlertDialog.Builder(Project_Home_Activity.this);

builder.setTitle("This is title");

builder.setMessage("this is Message");

builder.setCancelable(false);

builder.setPositiveButton("确定", new DialogInterface.OnClickListener() {

@Override

    public void onClick(DialogInterface dialogInterface, int i) {

}

});

builder.setNegativeButton("取消", new DialogInterface.OnClickListener() {

@Override

    public void onClick(DialogInterface dialogInterface, int i) {

}

});

builder.show();

二、ProgressDialog

ProgressDialogdialog =new ProgressDialog(Project_Home_Activity.this);

dialog.setTitle("This is ProgressDialog");

dialog.setMessage("Loading...");

dialog.setCancelable(true);

dialog.show();


三、自定义控件


隐藏导航栏

android.support.v7.app.ActionBar actionBar = getSupportActionBar();

if (actionBar !=null) actionBar.hide();

你可能感兴趣的:(三、常用控件的使用)