Android 将videoview的内容设置为全屏
我有一个视频视图用于我的splashscreen。videoview占据屏幕的顶部,而下方则是空白部分。我想让视频全屏播放 这是我的xml文件:Android 将videoview的内容设置为全屏,android,android-layout,android-videoview,Android,Android Layout,Android Videoview,我有一个视频视图用于我的splashscreen。videoview占据屏幕的顶部,而下方则是空白部分。我想让视频全屏播放 这是我的xml文件: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" an
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#ffffff"
tools:context="com.example.acer.myapplication.splash">
<VideoView
android:id="@+id/videoView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="fill_vertical"/>
</LinearLayout>
对视频使用以下XML
<?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/videoView"
android:layout_width="fill_parent"
android:layout_alignParentRight="true"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_alignParentBottom="true"
android:layout_height="fill_parent">
</VideoView>
编辑
必须旋转视频才能在纵向模式下使用。使用将视频旋转90度,然后将其设置为splashscreen
对视频使用以下XML
<?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/videoView"
android:layout_width="fill_parent"
android:layout_alignParentRight="true"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_alignParentBottom="true"
android:layout_height="fill_parent">
</VideoView>
编辑
必须旋转视频才能在纵向模式下使用。使用将视频旋转90度,然后将其设置为splashscreen
请添加您当前看到的视图的屏幕截图。我添加了图像,这不会改变我视频的内容吗?是的,会的,因为您添加的视频处于横向模式,android会以默认大小播放。你可以拉伸它,但这不是一个好的做法。我在回答中添加了预期的视频屏幕。请检查。有什么方法可以直接获取内容吗?请添加您当前看到的视图的屏幕截图。我添加了图像,这不会改变我视频的内容吗?是的,会的,因为您添加的视频处于横向模式,安卓将以默认大小播放。你可以拉伸它,但这不是一个好的做法。我在回答中添加了预期的视频屏幕。请检查一下。有什么方法可以让我把内容弄清楚吗?