android - Navigation Drawer not occure on Status Bar -
actually trying navigation drawer want on status bar not below put kind of code make transparent still don't work xml layout like
<android.support.v4.widget.drawerlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent" android:fitssystemwindows="true" android:elevation="7dp"> <linearlayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <android.support.v7.widget.toolbar xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/tool_bar" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/actionbar_color" app:contentinsetend="0dp" app:contentinsetstart="0dp"></android.support.v7.widget.toolbar> <framelayout android:id="@+id/content_fragment" android:layout_width="match_parent" android:layout_height="match_parent" /> </linearlayout> <linearlayout android:id="@+id/drawer_linearlayout" android:layout_width="260dp" android:layout_gravity="start|top" android:layout_height="match_parent" android:orientation="vertical"> <imageview android:layout_width="match_parent" android:layout_height="168dp" android:scaletype="fitxy" android:src="@drawable/navigation_img" android:id="@+id/mytext"/> <listview android:id="@+id/navdrawer" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingleft="5dp" android:layout_below="@+id/mytext" android:layout_gravity="start|bottom" android:background="#ffffff" android:choicemode="singlechoice" android:divider="@android:color/transparent" android:dividerheight="0dp" android:listselector="@drawable/list_selector" android:paddingtop="5dp"></listview> </linearlayout> </android.support.v4.widget.drawerlayout>
my theme v-21
<style name="appthemes" parent="theme.appcompat.light.noactionbar"> <!-- customize theme here. --> <item name="android:windowtranslucentstatus">true</item> <item name="windowactionmodeoverlay">true</item> <item name="android:windowdrawssystembarbackgrounds">true</item> <item name="android:statusbarcolor">@android:color/transparent</item> <item name="colorprimary">@color/actionbar_color</item> <item name="colorprimarydark">@color/alert_normal</item> <item name="coloraccent">@color/actionbar_color</item> <item name="drawerarrowstyle">@style/drawerarrowstyle</item> </style>
when remove linearlayout , imageview work fine want imageview inside drawerlayout supports 2 child elements have use linearlayout please suggest me way way.
i got solution such layout. sorry posting late. have make little change in xml that.
<?xml version="1.0" encoding="utf-8"?> <android.support.v4.widget.drawerlayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent" android:elevation="7dp"> <linearlayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <include layout="@layout/app_bar"></include> <framelayout android:id="@+id/content_fragment" android:layout_width="match_parent" android:layout_height="match_parent" /> </linearlayout> <linearlayout android:id="@+id/drawer_linearlayout" android:layout_width="260dp" android:layout_gravity="left|start" android:layout_height="match_parent" android:orientation="vertical"> <imageview android:layout_width="match_parent" android:layout_height="168dp" android:scaletype="fitxy" android:src="@drawable/navigation_img" android:id="@+id/mytext" /> <listview android:id="@+id/navdrawer" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingleft="5dp" android:layout_below="@+id/mytext" android:layout_gravity="start|bottom" android:background="#ffffff" android:choicemode="singlechoice" android:divider="@android:color/transparent" android:dividerheight="0dp" android:listselector="@drawable/list_selector" android:paddingtop="5dp"></listview> </linearlayout> </android.support.v4.widget.drawerlayout>
and make theme style v-21 that.
<!-- base application theme. --> <style name="appthemes" parent="theme.appcompat.light.noactionbar"> <!-- customize theme here. --> <item name="android:windowtranslucentstatus">true</item> <item name="colorprimary">@color/actionbar_color</item> <item name="android:textcolor">@color/mynavigationcolor</item> <item name="android:statusbarcolor">@android:color/transparent</item> <item name="titletextstyle">@style/actionbartitletext</item> <item name="colorprimarydark">@color/actionbar_primary_color</item> <item name="coloraccent">@color/actionbar_color</item> <item name="drawerarrowstyle">@style/drawerarrowstyle</item> <item name="android:actionoverflowbuttonstyle">@style/myactionbuttonoverflow</item> </style>
and normal theme style
<style name="appthemes" parent="theme.appcompat.light.noactionbar"> <!-- customize theme here. --> <item name="colorprimarydark">@color/actionbar_primary_color</item> <item name="colorprimary">@color/actionbar_color</item> <item name="windowactionmodeoverlay">true</item> <item name="android:textcolor">@color/mynavigationcolor</item> <item name="drawerarrowstyle">@style/drawerarrowstyle</item> <item name="android:actionoverflowbuttonstyle">@style/myactionbuttonoverflow</item> </style>
hope if stuck in such situation, these solution you.
Comments
Post a Comment