首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >添加片段时FlyOut菜单设计问题

添加片段时FlyOut菜单设计问题
EN

Stack Overflow用户
提问于 2015-04-26 17:14:37
回答 1查看 232关注 0票数 1

当添加片段时,我正在尝试让我的“飞出”菜单工作。因此,由于下面的代码,我有了一个可以运行的“飞出”菜单:

https://github.com/garuma/FlyOutMenu/tree/master/FlyOutMenu

代码语言:javascript
复制
    <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由以下布局组成:

代码语言:javascript
复制
<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中添加了一个片段:

代码语言:javascript
复制
    // 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上发布图片,只有两个链接)

以下是问题所在:

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-04-27 07:25:41

我建议使用标准导航绘图。您可以在这里找到我的示例:https://github.com/jamesmontemagno/Xam.NavDrawer

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/29880787

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档