hi there I want align a set of icons in toolbar like below picture.
I googled and after some change I have:
mainActivity.xml
...
<include
android:id="@+id/tool_bar_bottom"
layout="@layout/tool_bar"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
/>
....
And in menu_bottom.xml:
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" tools:context=".MainActivity">
<item
android:id="@+id/action_forward"
android:title="forward"
android:orderInCategory="100"
android:icon="@drawable/ic_action_arrow_forward"
android:layout_alignParentRight="true"
app:showAsAction="always"
></item>
<item
android:id="@+id/action_zoom_in"
android:orderInCategory="200"
android:title="zoom in"
android:icon="@drawable/ic_action_zoom_in"
app:showAsAction="always"
></item>
<item
android:id="@+id/action_home"
android:orderInCategory="300"
android:title="home"
android:icon="@drawable/ic_action_home"
app:showAsAction="always"
></item>
<item
android:id="@+id/action_refresh"
android:orderInCategory="400"
android:title="refresh"
android:icon="@drawable/ic_action_refresh"
app:showAsAction="always"
></item>
<item
android:id="@+id/action_zoom_out"
android:orderInCategory="500"
android:title="zoom out"
android:icon="@drawable/ic_action_zoom_out"
app:showAsAction="always"
></item>
<item
android:id="@+id/action_back"
android:orderInCategory="600"
android:title="back"
android:icon="@drawable/ic_action_arrow_back"
android:layout_alignParentLeft="true"
app:showAsAction="always"
></item>
</menu>
I added android:layout_alignParentLeft/right="true"
for left and right also
According the picture,I wand float right icon to left and right icon to right.
Also I want float center all other icon beside each other...
The code do not any change.
Also I add android:layout_centerVertical = "true"
to all other icons...
how can correct display view?