当前使用的是Android 4.3设备。我使用的是优秀的答案provided here我能够减小AlertDialog
的个别项目的字体大小:如何设置AlertDialog项目高度?
<style name="AlertDialogTheme" parent="android:Theme.Dialog">
<item name="android:textSize">13sp</item>
</style>
对话本身内置有:
ContextThemeWrapper cw = new ContextThemeWrapper(this, R.style.AlertDialogTheme);
AlertDialog.Builder builder = new AlertDialog.Builder(cw);
然而,问题是即物品的单个高度仍保持不变 - 实际上,当您在对话框中滚动时,会显示第五个元素:
我试过setting the dividerHeight
但这只是增加了间距。我也将layout_margin
属性设置为0dp
,但没有成功。
这个对话框的正确样式定义是什么,以减少标签之间的空间?
请注意,我不想使用视图再次构建整个对话框。我想保留现有的AlertDialog。
您可能能够通过指定尺寸到Android属性'配置列表项的高度listPreferredItemHeight'(默认)或'listPreferredItemHeightSmall'(全息)在你的主题。 – corsair992