Android: remove left margin from actionbar's custom layout
If you are adding the Toolbar
via XML, you can simply add XML attributes to remove content insets.
<android.support.v7.widget.Toolbar
xmlns:app="schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/primaryColor"
android:contentInsetLeft="0dp"
android:contentInsetStart="0dp"
app:contentInsetLeft="0dp"
app:contentInsetStart="0dp"
android:contentInsetRight="0dp"
android:contentInsetEnd="0dp"
app:contentInsetRight="0dp"
app:contentInsetEnd="0dp" />
How to remove space in left and right side of Action Bar when used custom layout for action bar?
If you want more customization on ActionBar, Use the ToolBar as an Actionbar which is more customizable than the default ActionBar.
reduce left margin of navigation icon of toolbar in android
add these line into your toolbar xml
app:contentInsetLeft="0dp"
app:contentInsetStart="0dp"
app:contentInsetStartWithNavigation="0dp"
Related Topics
Android - Sms Broadcast Receiver
How to Detect When an Android Application Is Running in the Emulator
Android: How to Check If a View Inside of Scrollview Is Visible
How to Add Manifest Permission to an Application
Clicking Urls Opens Default Browser
How to Lay Out Views in Relativelayout Programmatically
Android Push Notifications: Icon Not Displaying in Notification, White Square Shown Instead
How to Handle Dynamic Json in Retrofit
How to Configure Gradle to Work "Offline" (Using Cached Dependencies)
Getinstance() Doesn't Work with Other Location Than Us-Central1 in Realtime Database
Does Android Support Near Real Time Push Notification
You Have Not Accepted the License Agreements of the Following Sdk Components
Android "Elevation" Not Showing a Shadow