1

默认的 AlertDialog 具有更大的 textSize 和更大的填充。

我可以像这样使用 Style 来控制 textSize

ContextThemeWrapper cw = new ContextThemeWrapper( this, R.style.AlertDialogTheme );
AlertDialog.Builder builder = new AlertDialog.Builder(cw);

然后

<style name="AlertDialogTheme" parent="android:Theme.Dialog">
    <item name="android:textSize">18sp</item>
</style>

现在如何调整 AlertDialog 的垂直间距/填充?下面的样式不会影响任何东西。或者至少我们也可以调整 RadioButton 的大小?

<style name="AlertDialogTheme" parent="android:Theme.Dialog">
    <item name="android:paddingTop">0dp</item>
    <item name="android:paddingBottom">0dp</item>
</style>

这条线是我想使用带有样式自定义的默认 AlertDialog。我不想创建自定义适配器只是为了为 AlertDialog 制作自定义视图。

谢谢

4

1 回答 1

0

我想除了使用适配器构建完整的自定义对话框之外别无选择。不管怎么说,还是要谢谢你。

于 2013-05-07T01:40:28.013 回答