这是我的xml,请参考它..
<item
android:id="@+id/menuEdit"
android:title="@string/str_edit" />
<item
android:id="@+id/menuDelete"
android:title="@string/str_delete" />
<item
android:id="@+id/menuFlag"
android:title="@string/str_flag" />
这是我应用的风格......
<style name="PopupMenu" parent="Widget.AppCompat.ListView.DropDown">
<item name="android:popupBackground">@drawable/drawable_discussion_add_comment</item>
<item name="android:divider">@color/colorDeSelected</item>
<item name="android:dividerHeight">@dimen/dimen_0.5</item>
<item name="android:itemBackground">@android:color/white</item>
</style>
<style name="itemTextStyle.AppTheme" parent="@android:style/TextAppearance.Widget.TextView.PopupMenu">
<item name="android:textColor">@color/color_app_text</item>
<item name="android:textSize">@dimen/sp_14</item>
<item name="android:gravity">center</item>
</style>
但这些都不起作用..仅适用于文字颜色和尺寸(甚至不是重力)
预期:选项菜单中项目之间的空格和分隔颜色