diff --git a/Runtime/GuruWebview/Runtime/GuruWebview.cs b/Runtime/GuruWebview/Runtime/GuruWebview.cs index e245c6e..8e95f37 100644 --- a/Runtime/GuruWebview/Runtime/GuruWebview.cs +++ b/Runtime/GuruWebview/Runtime/GuruWebview.cs @@ -17,7 +17,14 @@ namespace Guru var go = new GameObject("guru_webview"); Object.DontDestroyOnLoad(go); var view = go.AddComponent(); - view.Frame = new Rect(0,0, Screen.width, Screen.height); + // view.Frame = new Rect(0,0, Screen.width, Screen.height); + // SafeArea fit + var x = Screen.width - Screen.safeArea.width; + if (x < 0) x = 0; + var y = Screen.height - Screen.safeArea.height; + if (y < 0) y = 0; + view.Frame = new Rect(x, y, Screen.safeArea.width, Screen.safeArea.height); + view.SetUserInteractionEnabled(true); return view; } @@ -37,10 +44,9 @@ namespace Guru if (showToolbar) { - view.SetShowToolbarNavigationButtons(true); - view.SetBackButtonEnabled(true); + view.EmbeddedToolbar.ShowNavigationButtons(); + view.EmbeddedToolbar.SetDoneButtonText(" X "); view.EmbeddedToolbar.Show(); - // view.SetToolbarDoneButtonText("X"); } view.Load(url);