I was searching here and found something very interesting, the company logo on Toolbar
.
How do I put a company logo on Toolbar
?
I was searching here and found something very interesting, the company logo on Toolbar
.
How do I put a company logo on Toolbar
?
A simple way to do this is to create a% custom% and enter a Toolbar
with the logo. See in this case below, I placed a logo in the center of the toolbar. To not create in the same view , you can use a separate XML such as ImageView
and include in your toolbar.xml
using the tag main.xml
. See:
<android.support.v7.widget.Toolbar
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/wld_toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
android:minHeight="?attr/actionBarSize">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center">
<ImageView
android:layout_width="100dp"
android:layout_height="50dp"
android:src="@drawable/creative" />
</LinearLayout>
</android.support.v7.widget.Toolbar>
In this way, you can include your <include>
in your Toolbar
. See:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<include layout="@layout/toolbar"/>
</LinearLayout>
View the result image: