2016-10-18 5 views
1

私は深刻な疑念を持っています。アンドロイドスタジオのナビゲーションドロワーメニュー項目の右端に拡張可能なリストボタンを追加するにはどうすればよいですか?詳細については、私は私のイメージ... 私はちょうど私のポストを編集したの...投稿聞かせては下記を アンドロイド・スタジオのナビゲーション・ドロワーのメニュー項目の右側に拡張可能リスト・ボタンを追加するにはどうすればよいですか?

は私のactivity_main.xml

<?xml version="1.0" encoding="utf-8"?> 

<android.support.design.widget.CoordinatorLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:fitsSystemWindows="true" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    tools:context=".MainActivity"> 

    <android.support.design.widget.AppBarLayout 
     android:layout_height="wrap_content" 
     android:layout_width="match_parent" 
     android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" 
     android:id="@+id/view"> 

     <android.support.v7.widget.Toolbar 
      xmlns:android="http://schemas.android.com/apk/res/android" 
      xmlns:local="http://schemas.android.com/apk/res-auto" 
      android:id="@+id/toolbar" 
      android:layout_width="match_parent" 
      android:layout_height="?attr/actionBarSize" 
      app:layout_scrollFlags="scroll|enterAlways" 
      android:background="@color/red" 
      local:popupTheme="@style/ThemeOverlay.AppCompat.Light" 
      local:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" /> 

     <android.support.design.widget.TabLayout 
      android:layout_height="wrap_content" 
      android:layout_width="match_parent" 
      android:id="@+id/tabLayout" 
      android:background="@color/red" 
      app:tabIndicatorColor="@color/white" 
      app:tabTextAppearance="@style/MyStyle" 
      android:layout_below="@+id/toolbar" 
      android:scrollbars="horizontal" 
      android:layout_alignParentLeft="true"> 
     </android.support.design.widget.TabLayout> 

    </android.support.design.widget.AppBarLayout> 

    <android.support.v4.view.ViewPager 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:id="@+id/viewPager"> 
    </android.support.v4.view.ViewPager> 
</android.support.design.widget.CoordinatorLayout> 

であり、ここで私のactivity_navigation.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" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:fitsSystemWindows="true" 
    tools:openDrawer="start"> 

    <android.support.design.widget.CoordinatorLayout 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:fitsSystemWindows="true" 
     tools:context="com.example.goserwizz.NavigationActivity"> 

     <android.support.design.widget.AppBarLayout 
      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/colorPrimary" 
       app:popupTheme="@style/AppTheme.PopupOverlay" /> 

     </android.support.design.widget.AppBarLayout> 

     <include layout="@layout/content_main" /> 

    </android.support.design.widget.CoordinatorLayout> 

    <FrameLayout 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:id="@+id/main_container"> 

    </FrameLayout> 

    <android.support.design.widget.NavigationView 
     android:id="@+id/navigation_view" 
     android:layout_height="match_parent" 
     android:layout_width="wrap_content" 
     android:layout_gravity="start" 
     app:headerLayout="@layout/header" 
     app:menu="@menu/menu_navigation"/> 


</android.support.v4.widget.DrawerLayout> 

そして、ここで私のmenu_navigation.xmlは今

<?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/Book_my_services" 
      android:title="Book my services" 
      android:icon="@drawable/book_my_service"/> 

     <item 
      android:id="@+id/My_services" 
      android:title="My services" 
      android:childIndicatorRight="30dp" 
      android:icon="@drawable/services" /> 
     <item 
      android:id="@+id/Add_your_vehicles" 
      android:title="Add your vehicles" 
      android:icon="@drawable/add_vehicle"/> 
     <item 
      android:id="@+id/Reschedule_slot" 
      android:title="Reschedule slot" 
      android:icon="@drawable/slot" /> 
     <item 
      android:id="@+id/Cancel_services" 
      android:title="Cancel services" 
      android:icon="@drawable/cancel_service"/> 
     <item 
      android:id="@+id/history" 
      android:title="History" 
      android:icon="@drawable/history"/> 
     <item 
      android:id="@+id/Payment" 
      android:title="Payment" 
      android:icon="@drawable/payment"/> 
    </group> 
    <item android:title="HELP"> 
     <menu> 
      <item 
       android:id="@+id/Emergency_assistant" 
       android:title="Emergency Assistant" 
       android:icon="@drawable/emergency" /> 
      <item 
       android:id="@+id/Call_support" 
       android:title="Call support" 
       android:icon="@drawable/call_support" /> 
      <item 
       android:id="@+id/Settings" 
       android:title="Settings" 
       android:icon="@drawable/settings" /> 


     </menu> 
    </item> 

    <item android:title="MORE"> 
     <menu> 
      <item 
       android:id="@+id/feedback" 
       android:title="Feedback" 
       android:icon="@drawable/feedback" /> 
      <item 
       android:id="@+id/How_it_works" 
       android:title="How it works" 
       android:icon="@drawable/how_it_work"/> 
      <item 
       android:id="@+id/FAQ" 
       android:title="FAQ" 
       android:icon="@drawable/faq"/> 
      <item 
       android:id="@+id/terms_and_conditions" 
       android:title="Terms and conditions" 
       android:icon="@drawable/terms_condition"/> 
      <item 
       android:id="@+id/Privacy_policy" 
       android:title="Privacy policy" 
       android:icon="@drawable/privacy"/> 
      <item 
       android:id="@+id/About" 
       android:title="About" 
       android:icon="@drawable/about"/> 
     </menu> 
    </item> 
</menu> 

で、イム必要があります私はナビゲーションメニュー項目の右側に展開可能なリストボタンを得ることができます。

Currently my navigation drawer looks similar to this

But i need my navigation drawer like this

私は、ナビゲーションメニュー項目の右側に拡張可能なリストボタンを必要としています。親切に...事前に感謝し、私を助けて.....

+0

メニューや別の引き出しレイアウトを使用してこれらのオプションを表示していますか? – Redman

+0

こんにちは...私は別のメニューを使用しています...これらのすべてのアイテムを表示するには – Arun

+0

これはほとんど不可能です。答えはYSL – Redman

答えて

4
<android.support.v4.widget.DrawerLayout 
xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:tools="http://schemas.android.com/tools" 
android:id="@+id/drawer_layout" 
android:layout_width="match_parent" 
android:layout_height="match_parent"> 

<FrameLayout 
    android:id="@+id/container" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" /> 

<fragment 
    android:id="@+id/navigation_drawer" 
    android:name="com.rooftap.adapterClass.NavigationDrawerFragment" 
    android:layout_width="@dimen/navigation_drawer_width" 
    android:layout_height="match_parent" 
    android:layout_gravity="start" 
    tools:layout="@layout/fragment_navigation_drawer" /> 

</android.support.v4.widget.DrawerLayout> 

は、あなたのfragment_navigation_drawer.xmlレイアウトがスピナーを追加したり、何でもあなたは私たちが通常のレイアウトで行う方法が好きとアクションのためNavigationDrawerFragment.classを作成したいカスタマイズします。 android.support.design.widget.NavigationViewは使用しないでください。

関連する問題