There's an unnecessary top padding between the header and the first item shown in this picture.
How it can be removed?
you can find the source code here: https://github.com/chrisbanes/cheesesquare
You can override predefined dimensions at your dimens.xml
as;
<dimen name="design_navigation_padding_top_default" tools:override="true">0dp</dimen> <dimen name="design_navigation_separator_vertical_padding" tools:override="true">0dp</dimen> <dimen name="design_navigation_padding_bottom" tools:override="true">0dp</dimen>
Other possible values are here: https://github.com/android/platform_frameworks_support/blob/master/design/res/values/dimens.xml
You should read the Ian's answer. The NavigationView follows the Material guidelines and you should not break these specs.
However, currently, you can override this value in your project.
Just add to your dimens.xml
:
<dimen name="design_navigation_separator_vertical_padding">0dp</dimen>
Warning:
The NavigationView
uses a LinearLayout
as header view. You can see this layout in the source code:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" android:paddingBottom="@dimen/design_navigation_separator_vertical_padding" />
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