当添加片段时,我正在尝试让我的“飞出”菜单工作。因此,由于下面的代码,我有了一个可以运行的“飞出”菜单:
https://github.com/garuma/FlyOutMenu/tree/master/FlyOutMenu
<com.myApp.FlyOutContainer xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/FlyOutContainer">
<include
layout="@layout/menu_layout"
android:id="@+id/menu_layout" />
<include
layout="@layout/content_layout"
android:id="@+id/content_layout" />
</comm.myApp.FlyOutContainer>在我的应用程序开始时,content_layout由以下布局组成:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/content"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<include
layout="@layout/top_bar_layout"
android:id="@+id/top_bar_layout" />
<include
layout="@layout/root_layout"
android:id="@+id/root_layout" />
</LinearLayout>开始后,我的活动在root_layout中添加了一个片段:
// Create new fragment and transaction
Fragment questionListFragment = new QuestionListFragment();
FragmentTransaction transaction = FragmentManager.BeginTransaction();
transaction.Add(Resource.Id.root_layout, questionListFragment);
// Commit the transaction
transaction.Commit();这个新的片段包含一个用来刷新布局的滑动和一个列表视图。当我从左向右滑动时,菜单会显示得很好。但是为了隐藏它(从右向左滑动),菜单在背景中。
更新:
我认为问题在notifyDataSetChanged上。当菜单打开时,我的视图没有居中,我更新了我的列表视图。所以当更新时,我的视图被重新创建和重新居中,菜单停留在背景中.我怎么才能修好它?
下面是截图来理解:(我还不能在stackOverflow上发布图片,只有两个链接)
以下是问题所在:

发布于 2015-04-27 07:25:41
我建议使用标准导航绘图。您可以在这里找到我的示例:https://github.com/jamesmontemagno/Xam.NavDrawer
https://stackoverflow.com/questions/29880787
复制相似问题