android - 如何在运行时更改 BottomSheetDialog 的主题
问题描述
我显示 BottomSheetDialog 像:
dialog = BottomSheetDialog(ctx, R.style.DialogTheme)
dialog.setContentView(R.lauout.dialog)
dialog.show()
<style name="DialogTheme" parent="Theme.Design.Light.BottomSheetDialog">
<item name="android:navigationBarColor">@color/white</item>
</style>
<style name="DarkDialogTheme" parent="Theme.Design.BottomSheetDialog"/>
我需要在运行时将 DialogTheme 主题更改为 DarkDialogTheme。当对话框被隐藏( dialog.hide() )时,我需要更改主题,但对话框没有被取消。帮我修一下。
解决方案
推荐阅读
- linux - 在centOS 7上就地awk
- python - 如何将这种类型的 numpy 数组存储到 HDF5 中,在每一行中都有一个 int 和一个由几个 int 组成的 numpy 数组,每行的大小不同
- visual-studio-2015 - MSVS 2015:有没有办法在反汇编窗口中查看纯粹的组件?
- c# - AWS DynamoDB:查询在控制台上有效,但在 .NET 代码上无效
- python - 在python中以2的间隔将列表元素插入到列表的第二个列表中
- r - 无法在 WSL Ubuntu 18.04 上安装 R Shiny Server
- terraform - 从父模块或兄弟模块访问 terraform 提供程序
- promise - 可以无限时间使用 Promise.in 吗?
- python - 使用切片删除字符串的特定子字符串
- javascript - 将其作为 JavaScript 函数的一部分编写的更有效的方法?