Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove padding from title in toolbar?

Tags:

My Toolbar

My toolbar

Google Play Toolbar

GooglePlay toolbar

How can I remove unnecessary padding?

My toolbar is inside the fragment My code in fragment:

public void setUpToolbar(Toolbar toolbar, String title, @DrawableRes int resId) {     toolbar.setTitle(title);     ((AppCompatActivity) getActivity()).setSupportActionBar(toolbar);     ActionBar ab = ((AppCompatActivity) getActivity()).getSupportActionBar();     ab.setHomeAsUpIndicator(resId);     ab.setDisplayHomeAsUpEnabled(true); } 

My toolbar in xml:

<android.support.v7.widget.Toolbar             android:id="@+id/toolbar"             android:layout_width="match_parent"             android:layout_height="?attr/actionBarSize"             app:layout_collapseMode="pin"             app:popupTheme="@style/AppTheme.PopupOverlay" /> 
like image 489
gape Avatar asked Jul 24 '16 16:07

gape


People also ask

How do I hide the overflow menu?

Remove your onCreateOptionsMenu() and onOptionsItemSelected() methods, along with the menu resource(s) that they use. Then, the overflow should never show up.


1 Answers

Use this inside your toolbar xml tag

app:contentInsetStartWithNavigation="0dp" 
like image 55
Abdul Rizwan Avatar answered Sep 27 '22 17:09

Abdul Rizwan