VideoView在Android中播放视频时不覆盖整个屏幕

问题描述:

我开发了一款使用VideoView播放视频的媒体播放器。它工作正常,但它有一个问题,播放视频底部有一个空白区域。你可以检查我的代码和播放器的屏幕截图。请在这方面帮助我,我会非常感谢你。提前致谢。VideoView在Android中播放视频时不覆盖整个屏幕

enter image description here

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:orientation="vertical" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    > 

    <VideoView 
     android:id="@+id/video_view" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
    /> 

</LinearLayout> 
+0

尝试:'的android:layout_width = “FILL_PARENT”' '机器人:layout_height = “FILL_PARENT”' – 2013-02-14 13:57:03

这应该工作,它会伸展你的视频,以填补所有的屏幕:

<?xml version="1.0" encoding="utf-8"?> 
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent"> 

    <VideoView android:id="@+id/videoViewRelative" 
     android:layout_alignParentTop="true" 
     android:layout_alignParentBottom="true" 
     android:layout_alignParentLeft="true" 
     android:layout_alignParentRight="true" 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent"> 
    </VideoView> 

</RelativeLayout>