今天项目需要使用AlertDialog,简单的一个demo如下

AlertDialog.Builder alertDialog = new AlertDialog.Builder(MainActivity.this,AlertDialog.THEME_HOLO_LIGHT);
alertDialog .setTitle("提示")
        .setIcon(R.mipmap.ic_launcher)
        .setMessage("取消之前所有编辑信息?")
        .setCancelable(false)
        .setPositiveButton("que", new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialog, int which) {
            }
        })
        .setNegativeButton("取消", new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialog, int which) {

            }
        }).create().show();


发现不能使用系统默认的AlertDialog样式

安卓AlertDialog5种系统默认样式不可用的解决方法

后来发现是导入包的问题

安卓AlertDialog5种系统默认样式不可用的解决方法

android.support.v7.app.AlertDialog换成android.app.AlertDialog问题解决


安卓AlertDialog5种系统默认样式不可用的解决方法


...




 
                    
            
                

相关文章:

  • 2022-12-23
  • 2021-11-27
  • 2022-12-23
  • 2022-12-23
  • 2021-07-08
  • 2021-12-14
  • 2022-12-23
  • 2021-12-18
猜你喜欢
  • 2021-10-06
  • 2021-12-13
  • 2021-12-05
  • 2022-12-23
  • 2021-10-23
  • 2021-06-02
  • 2021-10-26
相关资源
相似解决方案