Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/202.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_Listview_Scrollview - Fatal编程技术网

Android中视频和文本布局的滚动视图

Android中视频和文本布局的滚动视图,android,listview,scrollview,Android,Listview,Scrollview,我做了一个布局,在上面声明了视频,然后在下面声明了文本。现在我可以使文本滚动,但视频仍保持在顶部。我希望视频+文本可以滚动 为了实现这一目标,我不知怎么做了,但我不认为这是一个好办法。我创建了两个XML文件,在其中一个文件中,我将视频放在上面,文本放在下面。在第二部分,我调用了这个布局,使它成为带有滚动的列表视图。请告诉我一个实现视频和文本滚动的干净方法。尝试以下方法: <ScrollView android:layout_width="match_parent" androi

我做了一个布局,在上面声明了视频,然后在下面声明了文本。现在我可以使文本滚动,但视频仍保持在顶部。我希望视频+文本可以滚动

为了实现这一目标,我不知怎么做了,但我不认为这是一个好办法。我创建了两个XML文件,在其中一个文件中,我将视频放在上面,文本放在下面。在第二部分,我调用了这个布局,使它成为带有滚动的列表视图。请告诉我一个实现视频和文本滚动的干净方法。

尝试以下方法:

<ScrollView
   android:layout_width="match_parent"
   android:layout_height="match_parent">
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical" >   
         <VideoView
              android:id="@+id/video_view"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content" >
          </VideoView>
          <TextView
              android:id="@+id/text"
              android:layout_width="wrap_content"
              android:layout_height="match_parent"
              android:text="@string/your_text" >
          </TextView>
    </LinearLayout>
</ScrollView>

请发布您的代码,看看您做了什么