Xamarin Android右侧导航抽屉 - 仅限右侧
问题描述:
This tutorial侧重于如何使用支持库v7中的操作栏抽屉开关,与左侧导航抽屉一起实现右侧导航抽屉。Xamarin Android右侧导航抽屉 - 仅限右侧
我只想要正确的导航抽屉 怎么样?
右侧的菜单图标?没有离开
答
您可以设置一个单一的ListView这样的:
<android.support.v4.widget.DrawerLayout
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 Left 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"/>-->
<!-- The Right navigation drawer -->
<ListView
android:id="@+id/right_drawer"
android:layout_width="240dp"
android:layout_height="match_parent"
android:layout_gravity="right"
android:choiceMode="singleChoice"
android:divider="#E2E2E2"
android:dividerHeight="1dp"
android:background="#9E9E9E"/>
</android.support.v4.widget.DrawerLayout>
属性:android:layout_gravity="right"
意味着加载它形成的权利,将其设置为Left Navigation Drawer
。您可以通过Toolbar
调整菜单图标的位置。
如果你想了解更多的细节信息,你可以看到this。