navigation drawer - Dark Background in NavigationDrawer in Android -


i have problem making navigation drawer in app:

in screenshot below can see darker area in navigation view...

can tell me how remove darker area? second issue: why margin-top not work? see "large text" isn't shown correctly!

the margin-top , dark area don't work!

here's code:

-main_activity:

<?xml version="1.0" encoding="utf-8"?> <android.support.v4.widget.drawerlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/drawer_layout" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" android:fitssystemwindows="true" tools:opendrawer="start">  <include     layout="@layout/content_main"     android:layout_width="match_parent"     android:layout_height="match_parent" />  <android.support.design.widget.navigationview     android:layout_width="match_parent"     android:layout_height="match_parent"     android:layout_margintop="?attr/actionbarsize"     android:id="@+id/nav_view"     android:layout_gravity="start"     android:fitssystemwindows="true"     app:headerlayout="@layout/nav_header"     app:menu="@menu/nav_drawer_menu" />  </android.support.v4.widget.drawerlayout> 

-nav_header

<?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/coloraccent">  <textview     android:layout_width="wrap_content"     android:layout_height="wrap_content"     android:textappearance="?android:attr/textappearancelarge"     android:text="large text"     android:id="@+id/txvaccountname"     android:paddingleft="10dp"     android:paddingtop="10dp" />  <textview     android:layout_width="wrap_content"     android:layout_height="wrap_content"     android:textappearance="?android:attr/textappearancemedium"     android:text="medium text"     android:id="@+id/txvaccountemail"     android:paddingleft="10dp"     android:paddingtop="5dp" /> </linearlayout> 

can tell me how remove darker area?

remove line in xml

android:background="@color/coloraccent" 

also, see if looks better. not sure if need toolbar, looks using appcompatactivity.

<linearlayout   xmlns:android="http://schemas.android.com/apk/res/android"   xmlns:app="http://schemas.android.com/apk/res-auto"   android:layout_width="match_parent"   android:layout_height="match_parent"   android:fitssystemwindows="true"   android:orientation="vertical">    <android.support.v7.widget.toolbar     android:id="@+id/toolbar"     android:layout_width="match_parent"     android:layout_height="@dimen/abc_action_bar_default_height_material"     android:background="?attr/colorprimary"     android:theme="@style/themeoverlay.appcompat.dark.actionbar"/>    <android.support.v4.widget.drawerlayout     android:id="@+id/drawer_layout"     android:layout_width="match_parent"     android:layout_height="match_parent">      <!-- real content goes here -->     <include         layout="@layout/content_main"         android:layout_width="match_parent"         android:layout_height="match_parent" />      <!-- navigation drawer -->     <android.support.design.widget.navigationview       android:id="@+id/nav_view"       android:layout_width="wrap_content"       android:layout_height="match_parent"       android:layout_gravity="start"       app:headerlayout="@layout/nav_header"       app:menu="@menu/nav_drawer_menu"/>    </android.support.v4.widget.drawerlayout> </linearlayout> 

Comments

Popular posts from this blog

routing - AngularJS State management ->load multiple states in one page -

python - GRASS parser() error -

json - Gson().fromJson(jsonResult, Myobject.class) return values in 0's -