How to use a PNG image in the toolbar instead of text.

I really enjoy your app so far. Laid out nice and easy to customize. In the toolbar, there are 3 sections. Specifically, in the section that reads, “Your app name” instead of putting the name of the app, I would like to place a “logo” png file. I’m sure this is simple but I am just unfamiliar with the proper code I need to pull the logo image. I would rather have a logo in that space.

  1. Af first resizes your logo as a minimum size with height 32px max. Then rename your png file and paste in drawable folder.
  2. Open activity_home.xml file.
  3. Then add this line android:visibility=”gone” where the ID is txt_toolbar_title.
  4. Then add this line of code after the <TextView /> blog.
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_toEndOf="@+id/img_left_menu"
android:layout_toStartOf="@+id/img_right_menu"
android:gravity="center"
android:src="@drawable/ic_logo"/>

Leave a Reply