DrawerLayout不与Android 4.4和放大器的工作; SurfaceView [英] DrawerLayout not working with Android 4.4 & SurfaceView

查看:512
本文介绍了DrawerLayout不与Android 4.4和放大器的工作; SurfaceView的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

今天,我再次拥有了这些机器人的时刻之一,这给我留下毫无本事。

Today I had one of those "android" moments again, which left me absolutely clueless.

我有它由一个DrawerLayout,其中包括一个RelativeLayout的作为一个SurfaceView(surfaceViewContainer)容器的应用程序和第二的ViewGroup(RelativeLayout的子类)作为导航。

I have an app which consists of a DrawerLayout, which includes a RelativeLayout as container for a SurfaceView (surfaceViewContainer) and a second ViewGroup (subclass of RelativeLayout) as navigation.

在应用程序启动时,在我的onCreate膨胀的布局和SurfaceView添加到surfaceViewContainer。

When the app starts, in onCreate I inflate the layout and add a SurfaceView to the surfaceViewContainer.

在三星S2 4.1.2和4.3一切正常一S3,我可以看到SurfaceView绘制的,我可以通过滑动手势或家庭按钮打开和关闭抽屉。然后,我在Android 4.4测试用的Nexus 5和Nexus 10上,抽屉不会出现在两台设备上。即使按下home键不会做的事情。

On a Samsung S2 with 4.1.2 and a S3 with 4.3 everything works fine, I can see the SurfaceView drawn and I can open and close the drawer, by swipe gesture or home button. Then I tested on Android 4.4 with a Nexus 5 and a Nexus 10, on both devices the drawer will not appear. Even pushing the home button won't do a thing.

更奇怪的。我甚至可以添加SurfaceView后加入SurfaceView,当我这样做,我可以与抽屉互动之前,打开抽屉,甚至是Android 4.4,所以开/关的作品然后

Even stranger : I can open the Drawer before adding the SurfaceView, when I do so I can interact with the Drawer even after adding the SurfaceView, even on Android 4.4, so open/close works then.

所以我的问题:任何人都经历过这样的事情还是有一些建议或知道什么可能从搭载Android 4.3改为4.4?

So my question : Anybody experienced something like this before or has some advice or knows what might have changed from Android 4.3 to 4.4?!

PS:我用DrawerLayout成功的其他应用程序已经,只是不能与SurfaceView,所以我认为问题在于有

ps: I used DrawerLayout successfully in other apps already, just not with SurfaceView, so I assume the problem lies there.

感谢

推荐答案

您是否尝试过使用在drawerLayour的drawerListener这样的实施onDrawerSlide

Have you tried using implementing onDrawerSlide on the drawerListener of the drawerLayour like this

@Override
    public void onDrawerSlide(View drawerView, float slideOffset)
    {
        super.onDrawerSlide(drawerView, slideOffset);
        mDrawerLayout.bringChildToFront(drawerView);
        mDrawerLayout.requestLayout();
    }

这篇关于DrawerLayout不与Android 4.4和放大器的工作; SurfaceView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆