0
此視頻視圖不會展開並將視頻放入視圖中。如果我設置靜態高度和寬度(例如640dp 400dp),則視頻會成功填充視圖並按預期工作。當在ScrollView中填充時,Android VideoView不會擴展
這個問題出現在我進入ScrollView安裝程序後 - 它在它自己的父LinearLayout中工作正常。
XML VideoView的:
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@color/gray">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/top_video"
android:layout_alignParentTop="true"
android:orientation="vertical"
android:visibility="gone">
<VideoView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="invisible"
android:layout_centerInParent="true"
android:id="@+id/video_view" />
</RelativeLayout>
<!---- many more layouts and views that all get hidden when setting above to visible -->
<!---- many more layouts and views that all get hidden when setting above to visible -->
</LinearLayout>
</ScrollView>