1

如何更改视频视图的布局参数(centerInParent)

<VideoView
        android:id="@+id/videoPlayer"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_centerInParent="false" />

<VideoView
        android:id="@+id/videoPlayer"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_centerInParent="true" />

问候基督徒

4

1 回答 1

0

您是说以编程方式设置 LayoutParams 吗?也许有可能使用这样的代码

    RelativeLayout.Layoutparams params = new RelativeLayout.LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT);
    params.addRule(RelativeLayout.CENTER_IN_PARENT);
于 2012-11-25T19:20:49.133 回答