我使用"@android:style/Theme.Holo“作为我游戏的主题:

但是为了能够设置snackbar小部件,我别无选择,只能使用"@style/Theme.AppCompat",,否则我会得到以下错误消息:
You need to use a Theme.AppCompat theme (or descendant) with the design library问题是"@style/Theme.AppCompat“在视觉上是完全不同的:

我能做些什么来保持与"@android:style/Theme.Holo",相同的视觉效果,但同时能够使用snackbar小部件?
使用Yoann Hercouet的解决方案编辑,结果如下:

少了什么?
发布于 2016-04-25 14:06:45
我终于找到了解决办法:
AndroidManifest.xml:
<application
android:theme="@style/Theme.AppCompat"
...MyDialog.java:
new AlertDialog.Builder(new ContextThemeWrapper(context, android.R.style.Theme_Holo_Dialog));而不是:
new AlertDialog.Builder(context);发布于 2016-04-25 10:50:47
尝试通过更改对话框的默认样式来更新应用程序主题:
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
...
<item name="alertDialogTheme">@android:style/Theme.Holo.Dialog</item>
</style>编辑
不知道它为什么不改变任何东西,它在我的应用程序上起作用了,也许可以尝试另一种方式,并创建一个自定义样式:
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
...
<item name="alertDialogTheme">@style/myAlertDialogStyle</item>
</style>
<style name="myAlertDialogStyle" parent="android:style/Theme.Holo.Dialog">
...
</style>https://stackoverflow.com/questions/36838033
复制相似问题