E
E
eeennyg2019-04-14 20:28:35
Java
eeennyg, 2019-04-14 20:28:35

How to center the application title in the title?

Hello! Let me explain the essence of the matter. When I open my application on the phone, there is its name at the top. So I need to make sure that this title is centered, not left-aligned. I'm a newbie, google didn't help

Answer the question

In order to leave comments, you need to log in

2 answer(s)
L
Lordao, 2019-04-14
@Lordao

<androidx.appcompat.widget.Toolbar
                android:id="@+id/toolbar"
                android:layout_width="match_parent"
                android:layout_height="?attr/actionBarSize"
                android:background="@color/colorPrimary">

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="Title"
                    android:layout_gravity="center"
                    android:id="@+id/toolbar_title" />

</androidx.appcompat.widget.Toolbar>

O
Oleg, 2019-04-14
@402d

https://stackoverflow.com/questions/39536815/cente...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question