问题
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