LoginSignup
0
0

More than 3 years have passed since last update.

【Xamarin.Forms】Rg.Plugins.PopupでYoutubeのフルスクリーンがうまく表示されない

Last updated at Posted at 2019-09-21

背景

Xamarin.FormsのAndroidでYoutubeの全画面再生がやりたかった。

実装

下記を参考にして全画面表示対応のWebViewを作り、Rg.Plugins.Popupのページに表示させた。
mhaggag/XFAndroidFullScreenWebView: A sample for Xamarin Forms Android FullScreen WebView

現象

Rg.Plugins.Popupのページで全画面再生すると真っ黒の画面しか表示されない。

Screenshot_1569032669.png

回避方法

Rg.Plugins.PopupではなくNavigationPageNavigation.PushAsyncを使う。

App.xaml.cs

public App()
{
    InitializeComponent();

    MainPage = new NavigationPage(new MainPage());
}
private async Task PushAsyncYoutubeWebViewPage()
{
    await Navigation.PushAsync(new YoutubeWebViewPage());
}

タイトルバーが不要な場合

対象のページのXamlにNavigationPage.HasNavigationBar="False"を追加。

<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             ...
             NavigationPage.HasNavigationBar="False">
</ContentPage>
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0