【发布时间】:2013-04-01 07:10:37
【问题描述】:
默认的 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 制作自定义视图。
谢谢
【问题讨论】:
-
我在尝试设置 AlertDialog 复选框的样式时发现了类似问题。并非默认中的所有项目都可以设置样式。您必须继续制作完整的自定义对话框,包括布局等。
标签: android styles customization android-alertdialog