Я пробовал разные методы, но не смог разместить веб-просмотр в середине моего LinearLayout
(или экрана)
Я загружаю только один элемент в моем WebView
, который является YouTube Video iFrame
My Layout является следующим, который содержит веб-просмотр
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:background="#0c0000"
android:id="@+id/webviewlayoutVDO">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/loadinglayout"
android:gravity="center">
<ProgressBar
android:id="@+id/theloadingbar"
style="?android:attr/progressBarStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:id="@+id/webviewlayoutVDOInternal">
<WebView
android:id="@+id/webviewVideo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="0dp"
android:layout_marginRight="0dp"
android:gravity="center" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:id="@+id/videoDetails"
android:gravity="bottom">
<TextView
android:id="@+id/videoText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="PLAY"
android:textColor="@color/colorPrimary"
android:gravity="bottom|center" />
</LinearLayout>
</android.support.design.widget.CoordinatorLayout>
Результаты следующие

Я хочу, чтобы он был прямо посередине вместо загрузки iframe вверху.
Я попытался добавить css
, чтобы центрировать iframe, но я закончилдо создания беспорядка.
Есть ли способ сделать это?
Ниже приведен мой код веб-просмотра
webView.Settings.JavaScriptEnabled = true;
webView.Settings.LoadWithOverviewMode = true;
webView.Settings.UseWideViewPort = false;
webView.SetBackgroundColor(Android.Graphics.Color.Black);
webView.LoadDataWithBaseURL("https://.", IFRAME_CONTENT, "text/html", "UTF-8", null);