本文介绍了Android NavigationDrawer透明度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经按照本教程
我的结果在此屏幕截图上.
My result is on this screenshot.
问题是如何在看起来像背景文字的Drawer上删除或配置这些透明度.
The question is how to remove or configure these transparency on Drawer which looks awful with background text.
更新:这是我的布局配置,背景设置为暗
UPDATE:here is my layout configuration, with background been set to dark
<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
android:id="@+id/content_frame"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<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="#111111"/>
</android.support.v4.widget.DrawerLayout>
推荐答案
感谢所有尝试回答我的问题的人.抱歉,麻烦在于代码中的Fragment初始化.
Thanks everyone who tried to answer my question.I'm sorry the trouble was in Fragment initialization in code.
因此,我尝试将片段添加为新实例,但这应该只是布局中已经定义的片段的替换,如下所示:
So I've tried to add fragment as new instance, but it should be just a replacement of already defined fragment in layout as follows:
android.support.v4.app.FragmentManager fragmentManager = getSupportFragmentManager();
FeedFragment fragment = new FeedFragment();
fragmentManager.beginTransaction().replace(R.id.content_frame, fragment).commit();
现在一切正常.
这篇关于Android NavigationDrawer透明度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!