You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2021/04/22 16:32:12 UTC

[GitHub] [cordova-plugin-statusbar] nielsjakob edited a comment on issue #112: how to get statusbar height

nielsjakob edited a comment on issue #112:
URL: https://github.com/apache/cordova-plugin-statusbar/issues/112#issuecomment-824996178


   > This is what I did.
   
   @ronn9419 That doesn't work for me unfortunately. The following does sort of, but only if I manually set a rather long delay (1000ms)...
   
   (Why are you using `Plugins.StatusBar.setOverlaysWebView({overlay: false})` instead of `StatusBar.overlaysWebView(false)`?)
   
   ```
   (async () => {
         await StatusBar.overlaysWebView(false);
         var initialHeight = document.documentElement.clientHeight;
         await StatusBar.overlaysWebView(true);
         await delay(1000);
         var currentHeight = document.documentElement.clientHeight;
         console.log('safeArea', currentHeight - initialHeight);
       })();
       function delay(ms) { return new Promise(resolve => setTimeout(resolve, ms)); }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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