按下Android菜单按钮后,屏幕上出现黑框

时间:2016-11-30 12:38:19

标签: android xml android-layout

我正在Android Studio中为我的实习创建一个库类。我创建了一个自定义RelativeLayout来扩展下面显示的布局。

我无法在任何地方找到这个问题,所以我希望有人能够帮助我。 我有一个如下所示的布局文件:

<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <FrameLayout
        android:id="@+id/videoFrame"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:layout_centerInParent="true"
        android:background="@color/wallet_holo_blue_light">

        <VideoView
            android:id="@+id/videoBackground"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_gravity="center"
            android:background="@null"/>
    </FrameLayout>

</RelativeLayout>

我确实需要FrameLayout,以便能够缩放VideoView,其中VideoView的宽度大于此布局被充气的父级。我在运行时级别动态调整了这个VideoView的大小,但一切正常。

当我使用此VideoView开始活动时,一切都很好。 每当我点击 Android&#34; Windows&#34; -button 并返回活动时,就会出现一个黑框。

Screenshots

它也出现在肖像模式下。然后黑匣子甚至超过屏幕的一半。

更改screenOrientation后,所以旋转我的平板电脑,例如,黑盒子再次消失。

我真的不知道,有谁知道问题可能是什么?

0 个答案:

没有答案
相关问题