У меня есть приложение, показывающее видео в видеообъявлении.Центр видео в портретном режиме
Когда у меня есть приложение в ландшафтном режиме, видеоролик показывает полноэкранный режим, который хорош. Когда я ставлю свой видеоролик в портретном режиме, ширина видео - это ширина экрана, а высота масштабируется.
Проблема в том, что видеоизображение отображается в верхней части экрана. Я хочу, чтобы он показывался в середине экрана (по центру).
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2009 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android">
<FrameLayout android:id="@+id/fullscreen_custom_content"
android:visibility="gone"
android:background="@color/black"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
<LinearLayout android:id="@+id/linearlayout"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout android:id="@+id/error_console"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" />
<!-- webview will be put in the next framelayout -->
<FrameLayout
android:id="@+id/main_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
<VideoView
android:id="@+id/surface_vie"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</LinearLayout>
</FrameLayout>
Как установить видеоизображение в центре в портретном режиме?
возможно андроида: layout_centerInParent = "истинный" "? http://developer.android.com/reference/android/widget/RelativeLayout.LayoutParams.html#attr_android:layout_centerInParent – rperryng