Android   发布时间:2022-04-28  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了android – 同一个Activity上的两个导航抽屉大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
是否可以在同一活动中配置两个导航抽屉,一个来自左边,另一个来自右边?

解决方法

您可以使用抽屉布局
<android.support.v4.widget.DrawerLayout
   xmlns:android="http://scheR_482_11845@as.android.com/apk/res/android"
   android:id="@+id/drawer_layout"
   android:layout_width="match_parent"
   android:layout_height="match_parent">
   <!-- The main content view -->

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

<!-- The navigation drawer -->
    <ListView android:id="@+id/left_drawer"
       android:layout_width="240dp"
       android:layout_height="match_parent"
       android:layout_gravity="start"
       android:choiceMode="singleChoice"
       android:divider="@android:color/transparent"
       android:dividerHeight="0dp"
       android:BACkground="#111"/>


   <ListView android:id="@+id/right_drawer"
       android:layout_width="240dp"
       android:layout_height="match_parent"
       android:layout_gravity="end"
       android:choiceMode="singleChoice"
       android:divider="@android:color/transparent"
       android:dividerHeight="0dp"
       android:BACkground="#111"/>
 </android.support.v4.widget.DrawerLayout>

还要检查文档https://developer.android.com/training/implementing-navigation/nav-drawer.html

确保使用工具栏而非操作栏

大佬总结

以上是大佬教程为你收集整理的android – 同一个Activity上的两个导航抽屉全部内容,希望文章能够帮你解决android – 同一个Activity上的两个导航抽屉所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。