Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

当使用 iOS 风格中,当无标题时显示有点难看。 #238

Open
sfyc23 opened this issue Mar 26, 2021 · 1 comment
Open

当使用 iOS 风格中,当无标题时显示有点难看。 #238

sfyc23 opened this issue Mar 26, 2021 · 1 comment

Comments

@sfyc23
Copy link

sfyc23 commented Mar 26, 2021

当我使用

   MessageDialog.show(me, null, "这是一条消息", "确定");

弹出无标题对话框时,如图。

image

如果使用:

MessageDialog.show(me, "", "这是一条消息", "确定");

弹出标题为空白的对话框时,内容与顶部的空白又太多。

image

主要原因应该是在这里:
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" 替换就好看多了。
如图:
image

@y110231
Copy link

y110231 commented May 6, 2022

同样遇到 可以使用标题参数为null 内容前面用个换行符\n 样式好一些

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants