Android Navigation Drawer Layout throws an error -
The layout of the drawer uses two relative layouts, throws an error:
xml file :
& lt; 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" & gt; & Lt ;! - List view to display the slider menu - & gt; & Lt; RelativeLayout Android: id = "@ + id / relative_layout" Android: layout_width = "match_parent" Android: layout_height = "match_parent" android: layout_gravity = "start" & gt; & Lt; ExpandableListView android: id = "@ + id / list_slidermenu" Android: layout_width = "197.50dp" Android: layout_height = "fill_parent" Android: layout_gravity = "start" android: background = "# 2f2f2f" Android: choiceMode = "singleChoice" Android : Divider = "@ drawable / divider" Android: dividerHeight = "0.5dp" Android: Group Indicator = "@Android: Color / Transparent" Android: listSelector = "# 2FB3E3" /> & Lt; RelativeLayout Android: ID = "@ + ID / Layout" Android: layout_width = "match_perrent" Android: layout_heat = "wrap-content" Android: layout_lagin parentbottom = "true" & gt; & Lt; TextView Android "Android: textAppearanceMedium" id = "@ + id / build" style = Android: Layout_width = "Match_parent" Android: Layout_height = "Wrap_content" android: gravity = "center" Android: PaddingBottom = "L0dp" Android: paddingRight = "100dp" Android: Text = "My view" Android: textColor = "#FFFFFF" /> & Lt; / RelativeLayout & gt; & Lt; / RelativeLayout & gt; & Lt; /android.support.v4.widget.DrawerLayout>
02-18 September: 22: 53.649: E / AndroidRuntime (30768): java.lang.ClassCastException: android.support android.widget.RelativeLayout $ LayoutParams will not be molded can .v4.widget.DrawerLayout $ LayoutParams
public boolean OnPrepareOptionsMenu (menu) {// if the NAV drawer is opened, action items Boolean drawerOpen = mDrawerLayout.isDrawerOpen hide ( MDrawerList); If () {--------} and {--------} come back super. Peripherion options menu (menu); } "Exploration targeting" row Boolean drawer open = MDRwelloutout
Try
Boolean Drawer Open = mDrawerLayout.isDrawerVisible (Gravity.START); Boolean drawer open = MDRover layout.
In addition, I can not see navigation drawer
in my xml
as your parent tag & lt ; Android.support.v4.widget.DrawwerLayout / & gt; Must be
.
Update
Now you do not have the view to display without a drawer layout, you should write a FrameLayout
There are general items that appear without
Comments
Post a Comment