How to add separator between menu items in ActionBar?

How to add a separator between menu items in an ActionBar, how is this done in a Gmail application?

enter image description here

+7
source share
1 answer

Well, when I tried to create my own action bar, I used a black FrameLayout, which will display all the elements of the action bar. I set the layout_margin attribute for each element in 1dp so that it looks like there is a black separator on each side - if you want it to be larger, you can increase the margin.

<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> 
+2
source

All Articles