【问题标题】:Custom alertDialog in the listViewlistView中的自定义alertDialog
【发布时间】:2017-12-07 17:40:05
【问题描述】:

我无法在列表视图中创建自定义警报对话框。 下面的代码在 MainActivity 中正常工作,但在 customAdapter 中“getLayoutInflater()”为红色:

android.support.v7.app.AlertDialog.Builder cBuilder = new android.support.v7.app.AlertDialog.Builder(context);
                        View mView = getLayoutInflater().inflate(R.layout.custom_dialog_profil, null);



                        cBuilder.setView(mView);
                        android.support.v7.app.AlertDialog dialog = cBuilder.create();
                        dialog.show();

【问题讨论】:

    标签: android listview android-alertdialog


    【解决方案1】:

    你可以将getLayoutInflater改为LayoutInflater.from(context)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-05-09
      • 2020-01-08
      • 1970-01-01
      • 1970-01-01
      • 2018-04-19
      • 2019-04-10
      • 1970-01-01
      相关资源
      最近更新 更多