I want to set an icon at the end of the Toolbar , which will start another action. My Toolbar
<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="@dimen/abc_action_bar_default_height_material" android:background="#2B4AE0" app:theme="@style/ToolBarStyle"> <TextView android:id="@+id/headerText" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textAppearance="@android:style/TextAppearance.Theme" android:textColor="@android:color/white" /> <RelativeLayout android:id="@+id/notification" android:layout_width="50dp" android:layout_height="match_parent" android:clickable="true" android:gravity="center" /> <ImageView android:layout_width="25dp" android:layout_height="25dp" android:layout_centerHorizontal="true" android:layout_centerVertical="true" android:src="@drawable/bell_icon" /> </RelativeLayout> </android.support.v7.widget.Toolbar>
I've tried
android:layout_alignParentEnd="true"
and leave a margin, but it does not work properly.
android android-actionbar android-toolbar
shine_joseph
source share