7
如何在ActionBar中的菜单项之间添加分隔符,它同样也是在Gmail应用程序中创建的?如何在ActionBar中的菜单项之间添加分隔符?
如何在ActionBar中的菜单项之间添加分隔符,它同样也是在Gmail应用程序中创建的?如何在ActionBar中的菜单项之间添加分隔符?
好吧,当我试图让自己行动起来吧我用了一个黑色的FrameLayout在操作栏的所有项目将被显示。我在每个项目上设置layout_margin属性为1dp,这样看起来就像两边都有黑色的分隔符 - 如果你希望它更大,你可以增加边距。
<FrameLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#000000">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ImageButton ....... />
<ImageButton ...... android:layout_marginLeft="1dp"/> <!-- this will be shown as a separator-->
</LinearLayout>
</FrameLayout>