Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/223.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 查看水平滚动的图像,然后观看视频_Android_Scroll_Android Video Player - Fatal编程技术网

Android 查看水平滚动的图像,然后观看视频

Android 查看水平滚动的图像,然后观看视频,android,scroll,android-video-player,Android,Scroll,Android Video Player,我正在尝试在水平滚动视图中包含一个或两个图像后的视频 这是我为图像编写的代码,但我不知道如何将视频作为滚动图像的一部分 <?xml version="1.0" encoding="utf-8"?> <HorizontalScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_h

我正在尝试在水平滚动视图中包含一个或两个图像后的视频

这是我为图像编写的代码,但我不知道如何将视频作为滚动图像的一部分

<?xml version="1.0" encoding="utf-8"?>

<HorizontalScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:orientation="horizontal"
    android:background="@drawable/a">

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="fill_parent"
        android:orientation="horizontal"
        android:gravity="center">
            <ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/a" />
            <ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/b" />
            <ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/c" />
            <VideoView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@raw/fw1"
                />


图像和视频都将位于本地目录中。

用于显示您可以使用的视频。然而,这个解决方案并没有很好的文档记录,最好使用MediaPlayer类。有一个很好的教程解释如何使用它。你可以找到它