Android选项菜单与分隔
示例
在Android中,有一个默认的选项菜单,该菜单可以包含许多选项。如果需要显示更多的选项,则有必要对这些选项进行分组以保持清晰度。可以通过在它们之间放置分隔线(即水平线)来对选项进行分组。为了允许分隔符,可以使用以下主题:
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="android:dropDownListViewStyle">@style/PopupMenuListView</item>
</style>
<style name="PopupMenuListView" parent="@style/Widget.AppCompat.ListView.DropDown">
<item name="android:divider">@color/black</item>
<item name="android:dividerHeight">1dp</item>
</style>通过更改主题,可以将分隔线添加到菜单中。
热门推荐
10 儿子立冬祝福语简短独特
11 对当兵的祝福语简短
12 侄儿高考试祝福语简短
13 伴郎红包祝福语朋友简短
14 媳妇生日简短祝福语朋友
15 公司年会祝福语简短最好
16 元旦感恩祝福语简短大全
17 红包祝福语简短10字
18 周六早晨祝福语简短