Can I display material design Snackbar in dialog?

后端 未结 4 1752
隐瞒了意图╮
隐瞒了意图╮ 2021-01-17 12:24

I am developing an android application. In that I want to display material design Snackbar in dialog. Is it possible? If yes then how?

Please help me.

Thanks

4条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-17 12:52

    Use getDialog().getWindow().getDecorView() inside Snackbar.make()

    Snackbar
          .make(getDialog().getWindow().getDecorView(), "SnackBar in Dialog", Snackbar.LENGTH_LONG)
          .show();
    

提交回复
热议问题