You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ma...@apache.org on 2026/02/21 10:46:25 UTC

(cordova-plugin-inappbrowser) 01/01: fix(ios): contraint warnings in iOS 18 and older

This is an automated email from the ASF dual-hosted git repository.

manuelbeck pushed a commit to branch pr-ios-fix-contraints-warnings-in-older-ios
in repository https://gitbox.apache.org/repos/asf/cordova-plugin-inappbrowser.git

commit 67339782a8baa4c77f5344e0a636424eb017fda8
Author: Manuel Beck <ma...@outlook.de>
AuthorDate: Sat Feb 21 11:46:11 2026 +0100

    fix(ios): contraint warnings in iOS 18 and older
    
    - On iOS 18 and older contraint warnings are logged when a zero frame is set and toolbar items are added. This a known iOS Bug, see: https://stackoverflow.com/questions/54284029/uitoolbar-with-uibarbuttonitem-layoutconstraint-issue. To avoid this a frame is set, which have no impact, because auto layout is used.
---
 src/ios/CDVWKInAppBrowser.m | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/ios/CDVWKInAppBrowser.m b/src/ios/CDVWKInAppBrowser.m
index 0c6feb8..9e00ffb 100644
--- a/src/ios/CDVWKInAppBrowser.m
+++ b/src/ios/CDVWKInAppBrowser.m
@@ -728,8 +728,12 @@ BOOL isExiting = NO;
     // We add our own constraints, they should not be determined from the frame.
     self.webView.translatesAutoresizingMaskIntoConstraints = NO;
 
-    // Toolbar init without frame
-    self.toolbar = [[UIToolbar alloc] init];
+    // Toolbar init with a symbolic frame
+    // On iOS 18 and older contraint warnings are logged when a zero frame is set and toolbar items
+    // are added.
+    // This a known iOS Bug, see: https://stackoverflow.com/questions/54284029/uitoolbar-with-uibarbuttonitem-layoutconstraint-issue
+    // To avoid this a symbolic frame is set, which have no impact, because auto layout is used
+    self.toolbar = [[UIToolbar alloc] initWithFrame:CGRectMake(0.0, 0.0, 100.0, 100.0)];
     self.toolbar.alpha = 1.000;
     self.toolbar.barStyle = UIBarStyleBlack;
     self.toolbar.clearsContextBeforeDrawing = NO;


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org