My Toolbar
Google Play 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" />
Remove your onCreateOptionsMenu() and onOptionsItemSelected() methods, along with the menu resource(s) that they use. Then, the overflow should never show up.
Use this inside your toolbar xml tag
app:contentInsetStartWithNavigation="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