Android滑动侧菜单的布局小部件如何
我想定制滑动面菜单,但我不知道如何使用它 我使用幻灯片菜单 为我编写activity_main.xml代码Android滑动侧菜单的布局小部件如何,android,android-layout,slidingmenu,Android,Android Layout,Slidingmenu,我想定制滑动面菜单,但我不知道如何使用它 我使用幻灯片菜单 为我编写activity_main.xml代码 <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layo
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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"
xmlns:tools="http://schemas.android.com/tools"
android:fitsSystemWindows="true"
android:background="#fff"
tools:context="app.mes.MainActivity"
android:gravity="center">
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimaryDark"
app:popupTheme="@style/AppTheme.PopupOverlay" />
</android.support.design.widget.AppBarLayout>
<com.google.android.gms.ads.AdView
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:id="@+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/appbar"
android:layout_centerHorizontal="true"
ads:adSize="SMART_BANNER"
ads:adUnitId="@string/banner_id">
</com.google.android.gms.ads.AdView>
<FrameLayout
android:id="@+id/drawer_container"
android:layout_below="@id/adView"
android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout
android:id="@+id/frame_container"
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.app.mes.views.CustomSwipeRefresh
android:id="@+id/swipe_refresh"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentTop="true"
android:layout_alignParentStart="true">
<ViewStub
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/view_stub"
android:layout_alignParentTop="true"
android:layout_alignParentStart="true" />
</app.mes.views.CustomSwipeRefresh>
</RelativeLayout>
</FrameLayout>
</FrameLayout>
<devlight.io.library.ntb.NavigationTabBar
android:id="@+id/ntb_horizontal"
android:layout_width="match_parent"
android:layout_height="45dp"
app:ntb_badge_gravity="top"
android:layout_alignParentBottom="true"
app:ntb_bg_color="@color/colorPrimaryDark"
app:ntb_inactive_color="@android:color/white"
app:ntb_badge_position="right"
app:ntb_badged="true"
app:ntb_scaled="true"
app:ntb_tinted="true"
app:ntb_title_mode="all"
app:ntb_titled="true"
app:ntb_swiped="true"/>
</RelativeLayout>
我如何使用它
谢谢,我刚开始学习android。我使用的修改代码不工作运行应用程序已停止
xmlns:android=”http://schemas.android.com/apk/res/android"
xmlns:app=”http://schemas.android.com/apk/res-auto"
android:id=“@+id/slide\u side\u菜单”
android:layout\u width=“匹配父项”
android:layout\u height=“match\u parent”
xmlns:tools=”http://schemas.android.com/tools"
android:fitsSystemWindows=“true”
android:background=“#fff”
工具:context=“app.mes..MainActivity”
android:gravity=“center”>
<?xml version="1.0" encoding="utf-8"?>
<com.lemonade.widgets.slidesidemenu.SlideSideMenuTransitionLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/slide_side_menu"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@color/colorPrimary"
android:padding="50dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="20dp"
android:layout_marginTop="20dp"
android:textColor="#ffffff"
android:text="Item 1"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:textSize="20dp"
android:textColor="#ffffff"
android:text="Item 2"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:textSize="20dp"
android:textColor="#ffffff"
android:text="Item 3"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:textSize="20dp"
android:textColor="#ffffff"
android:text="Item 4"/>
</LinearLayout>
<com.lemonade.widgets.slidesidemenu.SlideSideMenuContentCardView
android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#ffffff">
<!-- Optional: Tool Bar -->
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="@color/colorPrimaryDark">
<android.support.v7.widget.Toolbar
android:id="@+id/base_toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</android.support.design.widget.AppBarLayout>
</FrameLayout>
</com.lemonade.widgets.slidesidemenu.SlideSideMenuContentCardView>
</com.lemonade.widgets.slidesidemenu.SlideSideMenuTransitionLayout>
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/slide_side_menu"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:tools="http://schemas.android.com/tools"
android:fitsSystemWindows="true"
android:background="#fff"
tools:context="app.mes..MainActivity"
android:gravity="center">
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimaryDark"
app:popupTheme="@style/AppTheme.PopupOverlay" />
</android.support.design.widget.AppBarLayout>
<com.google.android.gms.ads.AdView
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:id="@+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/appbar"
android:layout_centerHorizontal="true"
ads:adSize="SMART_BANNER"
ads:adUnitId="@string/banner_id">
</com.google.android.gms.ads.AdView>
<FrameLayout
android:id="@+id/drawer_container"
android:layout_below="@id/adView"
android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout
android:id="@+id/frame_container"
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.app.mes..views.CustomSwipeRefresh
android:id="@+id/swipe_refresh"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentTop="true"
android:layout_alignParentStart="true">
<ViewStub
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/view_stub"
android:layout_alignParentTop="true"
android:layout_alignParentStart="true" />
</com.app.mes.views.NCCustomSwipeRefresh>
</RelativeLayout>
</FrameLayout>
</FrameLayout>
<devlight.io.library.ntb.NavigationTabBar
android:id="@+id/ntb_horizontal"
android:layout_width="match_parent"
android:layout_height="45dp"
app:ntb_badge_gravity="top"
android:layout_alignParentBottom="true"
app:ntb_bg_color="@color/colorPrimaryDark"
app:ntb_inactive_color="@android:color/white"
app:ntb_badge_position="right"
app:ntb_badged="true"
app:ntb_scaled="true"
app:ntb_tinted="true"
app:ntb_title_mode="all"
app:ntb_titled="true"
app:ntb_swiped="true"/>