安卓应用程序兼容性主题 - 对话框当大 [英] Android: App Compat Theme - Dialog When Large

查看:141
本文介绍了安卓应用程序兼容性主题 - 对话框当大的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用AppCompat库,但是没有对话的主题,并没有DialogWhenLarge主题,我可以扩展或使用。

I want to use AppCompat library, however there is no Dialog theme, and there is no DialogWhenLarge theme which I can either extend or use.

有没有一种方法,我可以扩展基本主题,并使其DialogWhenLarge,可能使用的文件夹和自定义样式的项目。

Is there a way I can extend the base theme and make it DialogWhenLarge, probably using folders and custom styling items.

感谢

推荐答案

关闭这张票了。对于任何人谁想要的答案看到这一点。

Closing this ticket down. For anyone who would like the answer see this.

动作条在DialogFragment

和文件夹这个自定义样式值,大

and this custom style in folder values-large

<style name="AppBaseTheme" parent="@style/Theme.AppCompat.Light">
    <!-- API 14 theme customizations can go here. -->
</style>

 <style name="MyAppCompatDialogTheme" parent="AppBaseTheme">
    <item name="android:windowIsFloating">false</item>
    <item name="android:windowContentOverlay">@null</item>
    <item name="android:windowSoftInputMode">stateAlwaysHidden</item>
    <item name="android:windowActionModeOverlay">true</item>
    <item name="android:windowIsTranslucent">true</item>
</style>

不过,我想我已经决定去使用DialogFragment的途径,我可以再加载到一个活动在手机上,或显示为在平板电脑上的对话,而不是这种半泥转向的活动进入方式一个对话框。

However I think I have decided to go down the route of using a DialogFragment which i can then load into an activity on the phone, or show as a dialog on tablet, rather than this semi-mashed way of turning an activity into a dialog.

这篇关于安卓应用程序兼容性主题 - 对话框当大的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆