Не понятный отступ
Добавлено: 17 мар 2016, 10:15
Здравствуйте, есть drawer menu когда выделяю 1 пункт меню его background становится серым, и видно что есть отступ между
nav_header_main и пунктом меню (activity_main_drawer) как убрать отступ вроде margin не где не прописывал
activity_main.xml
nav_header_main.xml
activity_main_drawer

nav_header_main и пунктом меню (activity_main_drawer) как убрать отступ вроде margin не где не прописывал
activity_main.xml
Код: Выделить всё
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:openDrawer="start">
<include
layout="@layout/app_bar_main"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<android.support.design.widget.NavigationView
android:id="@+id/nav_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:fitsSystemWindows="true"
app:headerLayout="@layout/nav_header_main"
app:menu="@menu/activity_main_drawer"
app:itemTextColor="@color/drawer_item"
app:itemIconTint="@color/drawer_item_ico"
app:itemBackground="@drawable/drawer_item"
android:background="@color/bg_bar_color"
/>
</android.support.v4.widget.DrawerLayout>
Код: Выделить всё
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/header_bar_color"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_top_margin"
android:theme="@style/ThemeOverlay.AppCompat.Dark"
android:orientation="vertical"
android:gravity="bottom"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/app_logo"
android:paddingTop="@dimen/logoTop"
android:paddingRight="@dimen/actionbar_logo_right_padding"
/>
<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/nav_header_desc_text_size"
android:text="@string/logo_desc"
android:id="@+id/logo_desc"
android:paddingTop="@dimen/top_logo_desc"
android:textColor="@color/bg_bar_color"
/>
</LinearLayout>
</LinearLayout>
Код: Выделить всё
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
<group android:checkableBehavior="single">
<item android:id="@+id/tree_cats"
android:icon="@drawable/ic_tree_cats"
android:title="@string/tree_cats"
/>
<item android:id="@+id/favorite"
android:icon="@drawable/ic_favorite_btn"
android:title="@string/favorite"
/>
<item android:id="@+id/search_menu"
android:icon="@drawable/actionbar_search"
android:title="@string/search_menu"
/>
<item android:id="@+id/add_organization"
android:icon="@drawable/ic_add_btn"
android:title="@string/add_organization"
/>
<item android:id="@+id/price"
android:icon="@drawable/ic_price"
android:title="@string/price_menu"
/>
</group>
<item android:title="@string/info" >
<menu>
<group android:checkableBehavior="single">
<item android:id="@+id/rules"
android:icon="@drawable/ic_rules"
android:title="@string/rules" />
<item android:id="@+id/about"
android:icon="@drawable/ic_about"
android:title="@string/about" />
</group>
</menu>
</item>
</menu>