Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android toolbar menu overflow icon margin on tablets

When running on smartphone the toolbar textview is centralized,but running on tablet I am getting extra padding for overflow icon how can I get rid of them?

enter image description here enter image description here

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical">

    <android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:background="@android:color/white"
        android:fitsSystemWindows="true"
        app:popupTheme="@style/AppTheme.PopupOverlay">

        <TextView
            android:id="@+id/centerTitleToolbarTextView"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:gravity="center"
            android:maxLines="1"
            android:textColor="@color/color_toolbar"
            android:textSize="@dimen/titleToolbar" />

    </android.support.v7.widget.Toolbar>

    <View
        android:id="@+id/shadow_view"
        android:layout_width="match_parent"
        android:visibility="gone"
        android:layout_height="4dp"
        android:background="@drawable/toolbar_shadow" />

</LinearLayout>
like image 430
Arman Manucharyan Avatar asked Dec 30 '25 19:12

Arman Manucharyan


1 Answers

Try to add android:padding="0dp" for the Toolbar, it worked for me.

like image 104
jBegera Avatar answered Jan 02 '26 10:01

jBegera



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!