From 65c4f80772f07d80589c461fab4b475629d49c9c Mon Sep 17 00:00:00 2001 From: huyufei Date: Wed, 18 Sep 2024 14:19:28 +0800 Subject: [PATCH] =?UTF-8?q?update:=20=E5=8D=87=E7=BA=A7=E5=AE=89=E5=85=A8?= =?UTF-8?q?=E5=8C=BA=E9=80=82=E9=85=8D=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: huyufei --- Runtime/GuruWebview/Runtime/GuruWebview.cs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) 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);