1

大家好,我有一个视频没有在屏幕中央播放,但它卡在左侧,如何使视频在中间显示美观整洁?例如,我想要 horse.mp4 文件居中在屏幕上,不会像默认一样卡在左边

mVideoView.setVideoPath("hprse.mp4");

4

2 回答 2

0

<io.vov.vitamio.widget.VideoView android:id="@+id/surface_view" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_centerHorizontal="true" android:layout_centerVertical="true" /> 使其成为父布局的中心。

于 2013-05-31T01:52:32.853 回答
0

VitamioDemo有演示

<io.vov.vitamio.widget.CenterLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >

    <io.vov.vitamio.widget.VideoView
        android:id="@+id/surface_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_centerHorizontal="true"
        android:layout_centerVertical="true" />
</io.vov.vitamio.widget.CenterLayout>
于 2013-06-03T01:19:32.803 回答