[英]Android Support Library 22.1 and AlertDialog bug?
I tried to update my AlterDialog to the new android.support.v7.app.AlertDialog, just changing the: 我试图将我的AlterDialog更新为新的android.support.v7.app.AlertDialog,只是更改了:
import android.app.AlertDialog
to 至
import android.support.v7.app.AlertDialog
The new AlertDialogs are shown as Material style now on Pre-Lollipop, but the dialog window is much wider (tested on a Tablet). 新的AlertDialogs现在在Pre-Lollipop上显示为Material样式,但是对话框窗口更宽(在Tablet上测试)。 Is this not a bug? 这不是错误吗? Should be the android.support.v7.app.AlertDialog the same width than android.app.AlertDialog? android.support.v7.app.AlertDialog是否应与android.app.AlertDialog具有相同的宽度?
It is a Material specification. 这是材料规格。
However you can customize this spec, usign a custom theme. 但是,您可以自定义此规范,使用自定义主题。 For example something like this: 例如这样的事情:
<style name="AppCompatAlertDialogStyle" parent="Theme.AppCompat.Light.Dialog.Alert">
<!-- background, accent color..... -->
<item name="windowMinWidthMajor">30%</item>
<item name="windowMinWidthMinor">30%</item>
</style>
Material design generally makes use of more whitespace and greater margins / padding than previous Android design, so no - it's not a bug. 材质设计通常比以前的Android设计使用更多的空白和更大的边距/填充,所以不-这不是bug。
It matches the specifications listed here: http://www.google.com/design/spec/components/dialogs.html 它符合此处列出的规格: http : //www.google.com/design/spec/components/dialogs.html
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.