Custom dialog hasn't divider under the title

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-14 02:41:14

问题


At the official documentation there is an article of how to create custom dialogs. And there is also a picture of result dialog which have gradient border under it's title.

When I copy this code to run it on my machine and look at the results I get the dialog without gradient divider between the dialog's title and it's content:

Is this normal behavior and if it is, tell me how can I add divider by myself through the code, or using styles mechanism?


回答1:


Yes this is a normal behavior for custom dialog. To have the divider below title use something like:

    <View
    android:layout_width="fill_parent"
    android:layout_height="0.03dip"
    android:layout_marginLeft="5dip"
    android:layout_marginRight="5dip"
    android:layout_marginBottom="5dip"
    android:background="#404040" />

in your custom layout above the layout in which you have the imageview and textview.



来源:https://stackoverflow.com/questions/8877455/custom-dialog-hasnt-divider-under-the-title

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!