Android Toolbar Code Example


Example 1: android toolbar with menus

@Override public boolean onCreateOptionsMenu(Menu menu) {     getMenuInflater().inflate(R.menu.main_menu, menu);     return true; }

Example 2: android toolbar example

<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@android:color/white"> <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="58dp" android:background="?attr/colorPrimary" android:minHeight="?attr/actionBarSize" android:titleTextColor="#ffffff">  </android.support.v7.widget.Toolbar> </LinearLayout>

Comments

Popular posts from this blog

Converting A String To Int In Groovy

"Cannot Create Cache Directory /home//.composer/cache/repo/https---packagist.org/, Or Directory Is Not Writable. Proceeding Without Cache"

Android How Can I Convert A String To A Editable