DialogV3
DialogV3 copied to clipboard
当使用 iOS 风格中,当无标题时显示有点难看。
当我使用
MessageDialog.show(me, null, "这是一条消息", "确定");
弹出无标题对话框时,如图。
如果使用:
MessageDialog.show(me, "", "这是一条消息", "确定");
弹出标题为空白的对话框时,内容与顶部的空白又太多。
主要原因应该是在这里:
dialog_select_ios.xml 文件中:
<TextView
android:id="@+id/txt_dialog_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="20dp"
android:gravity="center"
android:text="标题"
android:textColor="@color/black"
android:textSize="17dp"
android:textStyle="bold" />
使用了 android:layout_marginTop="20dp"
如果在父元素控件 LinearLayout 中用 android:paddingTop="20dp" 替换就好看多了。
如图:
同样遇到 可以使用标题参数为null 内容前面用个换行符\n 样式好一些