如何使AlertDialog中的单选项看起来更紧凑?

时间:2013-04-01 07:10:37

标签: android styles customization alertdialog

默认的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制作自定义视图。

由于

1 个答案:

答案 0 :(得分:0)

我猜没有选择使用Adapter构建完全自定义Dialog。不管怎样,谢谢。