通常情况下,在使用VideoView播放视频时,布局文件中是这样定义的:
<VideoView
android:id="@+id/video_test"
android:layout_width="match_parent"
android:layout_height="match_parent" />
但是如果视频文件的分辨率与当前布局的空间比例有差异,这种情况下,即使设置了match_parent也不会充满屏幕。如果你不介意拉伸画面的话,可以在布局文件中定义:
<VideoView
android:id="@+id/video_test"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true" />