I am using Toolbar in my app and I custom the TextView to the center of the Toolbar but it not full width of the screen of toolbar and remain a little screen at the left side like the picture below. So how can I do to make the Custom TextView to the center of the screen and Toolbar?
My current screen problem :
The screen I want :
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="@color/colorPrimary"
app:theme="@style/ThemeOverlay.AppCompat.Dark"
xmlns:app="http://schemas.android.com/apk/res-auto">
<TextView
android:id="@+id/tv_title"
android:textColor="#FFF"
android:background="#F00"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="TITLE"
android:textStyle="bold"
android:textSize="15sp"
android:gravity="center"/>
</android.support.v7.widget.Toolbar>
Thank!
In your ToolBar
add below property to remove Left Padding.
app:contentInsetLeft="0dp"
app:contentInsetStart="0dp"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With