繁体   English   中英

打开导航抽屉时,框架布局消失

[英]Frame Layout fades away when opening navigation drawer

我正在用android开发一个移动应用程序以列出最新消息。 我已经实现了导航抽屉以选择类别。 为此,我使用了片段和框架布局。 当我打开导航抽屉时,背景中的布局似乎消失了,或者屏幕上的Brightennes变暗了。

有没有一种方法可以使我打开导航抽屉而不会淡化框架布局。(在xml文件中或以编程方式)

我无法发布图片(由于我的信誉度低),但是如果它有帮助,以下是我的xml文件。

<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/drawer_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <!-- Framelayout to display Fragments -->

    <FrameLayout
        android:id="@+id/frame_container"
        android:layout_width="match_parent"
        android:layout_height="match_parent" >
    </FrameLayout>
    <!-- Listview to display slider menu -->

    <ListView
        android:id="@+id/list_slidermenu"
        android:layout_width="240dp"
        android:layout_height="fill_parent"
        android:layout_gravity="start"
        android:background="@color/time_al_blue"
        android:choiceMode="singleChoice"
        android:listSelector="@drawable/list_selector"
        android:paddingTop="15dp" />

</android.support.v4.widget.DrawerLayout>

这种阴影称为稀松布色

您想使其透明,因此您的内容不会被遮盖,即

mDrawerLayout.setScrimColor(Color.TRANSPARENT);

如果要这样做,最好使用Jeremy Feinstein的“滑动菜单”

在这里,您可以找到他的库实现,如果您喜欢此解决方案,则可以使用它来替换导航抽屉。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM