2015-02-24 123 views
8

导航栏叠加在我的活动视图底部。像这里一样的问题:Android Navigation Bar overlaying my viewAndroid棒棒糖导航栏叠加活动视图

这个问题似乎只发生在Android棒棒糖上。在我的Moto G上使用KitKat 4.4.4。我没有这个问题。我不知道为什么这个问题只和棒棒糖有关。

我的问题是,与解决方案@ ps-glass postet不以某种方式设置fitsSystemWindow = true。我直接尝试了主题或布局文件,到目前为止没有任何工作。

这里是一个形象:https://drive.google.com/file/d/0B5g_MttTC7ZIQzNfS3Y2dVFKSFk/view?usp=sharing

你只能看到一点的文字,其余部分由导航栏覆盖。

+0

我发现了另一个使用库的解决方案(第4部分)https://mindofaandroiddev.wordpress.com/2013/12/28/making-the-status-bar-and-navigation-bar-transparent-with-a- listview-on-android-4-4-kitkat /但我不想为这个问题使用库。 – Moritz 2015-02-24 10:38:05

+0

可能的重复[Android L ActionBarActivity使用Feinstein SldingMenu和AppCompat v21在屏幕底部切断](http://stackoverflow.com/questions/27781023/android-l-actionbaractivity-using-feinstein-sldingmenu-and- appcompat-v21-is-cut) – whitaay 2015-03-18 15:20:16

+0

这是重复的。在这里看到我的解决方案:http://stackoverflow.com/a/28459582/969880 – whitaay 2015-03-18 15:21:00

回答

17

我发现这个问题与我们使用的库有关: https://github.com/jfeinstein10/SlidingMenu 和其他人在将AppCompat更新为v21后也有这个问题。

一些解决方案在这里https://github.com/jfeinstein10/SlidingMenu/issues/680张贴在这里The getDecorView method return view include navigation bar view on lollipop?

另一个从https://stackoverflow.com/users/715451/saulobrito的解决方案是现在的工作对我来说,这是我认为最简单的方法。

<style name="Theme" parent="FrameworkRoot.Theme"> 
    <item name="android:windowDrawsSystemBarBackgrounds">false</item> 
</style> 

我把这段代码片段放在我的主题res/values-v21文件夹中。

+0

谢谢你很多人。我被困在这个bug中好几天了。我认为这是棒棒糖中的一个错误。 – 2015-04-26 16:16:54

+0

它的工作原理,但状态栏的颜色消失... – Ziem 2015-05-08 08:05:22

+0

是的,这是因为它不是任何解决方案。如果我需要彩色状态栏怎么办? – user1209216 2016-09-20 12:58:09