导航项左侧和右侧的默认填充/边距 [英] Default Padding/Margin on the left and right side of the navigation item

查看:78
本文介绍了导航项左侧和右侧的默认填充/边距的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个带有导航抽屉活动的新 android 项目导航抽屉活动

I have created a new android project with Navigation Drawer Activity Navigation Drawer activity

我没有对项目进行任何更改,在创建项目后我直接运行了该项目.我得到了如下正确的输出:输出

I did not perform any changes in the project and after creating the project I have directly run that project. And I am getting proper output like the following: Output

现在的问题是如何去除导航项左右两边的padding/margin?左侧边距/填充 &右侧

Now the question is how to remove the padding/margin on the left and right side of the navigation item? Margin/Padding on Left & Right side

推荐答案

将此添加到 activity_main.xmlNavigationView 的属性:

Add this to the NavigationView's attributes in activity_main.xml:

app:itemShapeInsetBottom="0dp"
app:itemShapeInsetTop="0dp"
app:itemShapeInsetEnd="0dp"
app:itemShapeInsetStart="0dp"

这篇关于导航项左侧和右侧的默认填充/边距的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆