Android 支持 Library 22.1 和 AlertDialog 错误?

Android Support Library 22.1 and AlertDialog bug?

我尝试将我的 AlterDialog 更新为新的 android.support.v7.app.AlertDialog,只是更改了:

import android.app.AlertDialog

import android.support.v7.app.AlertDialog

新的 AlertDialogs 现在在 Pre-Lollipop 上显示为 Material 样式,但对话框 window 更宽(在平板电脑上测试过)。 这不是错误吗? android.support.v7.app.AlertDialog 应该与 android.app.AlertDialog 的宽度相同吗?

Material 设计通常比以前的 Android 设计使用更多的空白和更大的边距/填充,所以不 - 这不是错误。

它符合此处列出的规格: http://www.google.com/design/spec/components/dialogs.html

这是一个Material规范。

但是您可以自定义此规范,使用自定义主题。例如这样的事情:

<style name="AppCompatAlertDialogStyle" parent="Theme.AppCompat.Light.Dialog.Alert">
       <!-- background, accent color..... -->

       <item name="windowMinWidthMajor">30%</item>
       <item name="windowMinWidthMinor">30%</item>
   </style>