Nativescript: iOS ActionBar will be broken when internet sharing bar is displayed

Created on 28 May 2017  路  8Comments  路  Source: NativeScript/NativeScript

Which platform(s) does your issue occur on?

iOS

Please provide the following version numbers that your issue occurs with:

CLI: 3.0.0
Cross-platform modules: 3.0.0
Runtime(s): 3.0.1
Plugin(s): -

Please tell us how to recreate the issue in as much detail as possible.

  1. Deploy test app which enabled ActionBar into a real iPhone device
  2. Turn internet sharing on by iOS settings screen
  3. Connect other device to this iPhone(Tethering) to show blue "Internet sharing bar" on top of screen.
  4. back to the test app

-> Action Bar is broken


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

action-bar bug ios medium

Most helpful comment

@jilenloa @KBorecki @tsonevn

I have found workaround like below and sent PR. You can try to edit frame.ios.js in node_modules/tns-core-modules/ui/frame/ then test it by your application (with internet sharing or Alt+y on emulator).

(DP->DIP is not necessary if src is this._ios.controller.navigationBar.frame)

--- tns-core-modules/ui/frame/frame.ios.js.org  2017-06-23 22:39:55.000000000 +0900
+++ tns-core-modules/ui/frame/frame.ios.js  2017-06-23 22:40:19.000000000 +0900
@@ -306,7 +306,7 @@
         }
         this._ios.controller.navigationBar.autoresizingMask = 0;
         this._ios.controller.navigationBar.removeConstraints(this._ios.controller.navigationBar.constraints);
-        this._ios.controller.navigationBar.frame = CGRectMake(utils.layout.toDeviceIndependentPixels(this._ios.controller.navigationBar.frame.origin.x), utils.layout.toDeviceIndependentPixels(statusBarHeight), utils.layout.toDeviceIndependentPixels(this._ios.controller.navigationBar.frame.size.width), utils.layout.toDeviceIndependentPixels(this._ios.controller.navigationBar.frame.size.height));
+        this._ios.controller.navigationBar.frame = CGRectMake(this._ios.controller.navigationBar.frame.origin.x, utils.layout.toDeviceIndependentPixels(statusBarHeight), this._ios.controller.navigationBar.frame.size.width, this._ios.controller.navigationBar.frame.size.height);
     };
     return Frame;
 }(frame_common_1.FrameBase));

All 8 comments

Hi @kssfilo,
I reviewed your case and need the ActionBar element will not be shown properly, while the sharing bar has been displayed. We will research this problem and will provide the needed fix.
I am also attaching an image of the device, where the problem could be seen.
img_0158

hi, is there any solution or workaround for this yet?

Hi, the same here. this is annoying issue :(

Hi @jilenloa @KBorecki,
At this time this issue is still under review and there is no workaround which could be used. Most probably this behavior is related to an issue with the iOS constraints, while the bar is shown.

@jilenloa @KBorecki @tsonevn

I have found workaround like below and sent PR. You can try to edit frame.ios.js in node_modules/tns-core-modules/ui/frame/ then test it by your application (with internet sharing or Alt+y on emulator).

(DP->DIP is not necessary if src is this._ios.controller.navigationBar.frame)

--- tns-core-modules/ui/frame/frame.ios.js.org  2017-06-23 22:39:55.000000000 +0900
+++ tns-core-modules/ui/frame/frame.ios.js  2017-06-23 22:40:19.000000000 +0900
@@ -306,7 +306,7 @@
         }
         this._ios.controller.navigationBar.autoresizingMask = 0;
         this._ios.controller.navigationBar.removeConstraints(this._ios.controller.navigationBar.constraints);
-        this._ios.controller.navigationBar.frame = CGRectMake(utils.layout.toDeviceIndependentPixels(this._ios.controller.navigationBar.frame.origin.x), utils.layout.toDeviceIndependentPixels(statusBarHeight), utils.layout.toDeviceIndependentPixels(this._ios.controller.navigationBar.frame.size.width), utils.layout.toDeviceIndependentPixels(this._ios.controller.navigationBar.frame.size.height));
+        this._ios.controller.navigationBar.frame = CGRectMake(this._ios.controller.navigationBar.frame.origin.x, utils.layout.toDeviceIndependentPixels(statusBarHeight), this._ios.controller.navigationBar.frame.size.width, this._ios.controller.navigationBar.frame.size.height);
     };
     return Frame;
 }(frame_common_1.FrameBase));

When is this issue going to be fixed? We need it.... :-)

Thanks to @kssfilo the fix is already available with tns-core-modules@next and will be released officially with [email protected].

Hey, I am reopening this issue because I reproduce it on iOS 11 again.
image

Was this page helpful?
0 / 5 - 0 ratings

Related issues

OscarLopezArnaiz picture OscarLopezArnaiz  路  3Comments

yclau picture yclau  路  3Comments

dhanalakshmitawwa picture dhanalakshmitawwa  路  3Comments

NickIliev picture NickIliev  路  3Comments

guillaume-roy picture guillaume-roy  路  3Comments