java - Menu Icon and Title Icon display not working -
i want set menu icon(about app) rhs of title , icon(like button) lhs of title. android:icon doesn't seem work on manifest activity xml.
button: 1)without using toolbar getsupportactionbar().setdisplayhomeasupenabled(true); 2)with toolbar toolbar toolbar= (toolbar) findviewbyid(r.id.toolbar_gas_station); setsupportactionbar(toolbar); getsupportactionbar().setdisplayhomeasupenabled(true); icon: 1)without using toolbar have make menu file , override onoptionsitemselected , oncreateoptionsmenu write code accordingly 2)with toolbar: <android.support.design.widget.appbarlayout android:id="@+id/app_bar_layout" android:layout_width="match_parent" android:layout_height="wrap_content" android:theme="@style/themeoverlay.appcompat.dark.actionbar" android:fitssystemwindows="true"> <android.support.v7.widget.toolbar android:id="@+id/toolbar_gas_station" android:layout_width="match_parent" android:layout_height="?attr/actionbarsize" app:popuptheme="@style/themeoverlay.appcompat.light" > <linearlayout android:id="@id/ll_header_find_parking_map" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/colorprimary" android:gravity="right" android:padding="@dimen/fifteen"> <imageview android:id="@+id/iv_search_find_parking_map" android:layout_width="wrap_content" android:layout_height="match_parent" android:src="@drawable/search"/> </linearlayout> </android.support.v7.widget.toolbar> </android.support.design.widget.appbarlayout> can handle click event in normal imageview.
Comments
Post a Comment