[英]How to add menu options to the right side of each expandable list view item in android?
[英]How can i add the expandable list button on the right side of the navigation drawer's menu item in android studio?
我有一个严重的疑问。 如何在android studio中导航抽屉菜单项的右端添加可扩展列表按钮? 有关更多详细信息,请让我发布我的图片...我刚刚编辑了我的帖子...
下面是我的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>
现在,我应该在哪里进行更改,以便我可以获得导航菜单项右侧的可扩展列表按钮。
我需要导航菜单项右侧的可扩展列表按钮。 请帮助我...提前非常感谢.....
<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。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.