Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StatusBar gap cannot be detected in iOS with UIWebView. #33

Closed
omerduzyol opened this issue Apr 5, 2014 · 7 comments
Closed

StatusBar gap cannot be detected in iOS with UIWebView. #33

omerduzyol opened this issue Apr 5, 2014 · 7 comments
Labels

Comments

@omerduzyol
Copy link

When I embed F7 into UIWebView it detects device.status bar and adds with-statusbar-overlay class to body and looks like;

screenshot 2014-04-05 20 26 03

But I think I can detect UIWebView and iOS version 7 then change .navbar height from 44px to 64px and set padding-top:20px; to navbar-inner then it should be seen like this,

screenshot 2014-04-05 20 30 55

Btw, device.webview = !!navigator.standalone; returns false in UIWebView. But I able to detect UIWebView by checking User Agent. What do you think?

@nolimits4web
Copy link
Member

Right, i came to such solution instead of change navbar height for few reasons:

  • first of all, you probably should just color this statusbar-overlay with the color of navbar
  • what to do on pages without navbar? In this case status bar text will overlap page content. But with this solution it always will have bg color
  • and the most important part is that you can change its color dynamically. Try for example to open http://www.idangero.us/framework7/kitchen-sink/ in Chrome, in developer tools in Emulation section enable Emulate screen and set it 320x480 and reload page. You will see that this black overlay will appear. And then open left side panel and you will note that it change color to gray from black:) This feature used by many native apps. The closest example is a iPhone's Facebook app - status bar overlay change its color when you open panels

@nolimits4web
Copy link
Member

Btw, device.webview = !!navigator.standalone; returns false in UIWebView. But I able to detect UIWebView by checking User Agent. What do you think?

Didn't note that, then you are right, it should be changed to User Agent check. Share your solution please:)

@omerduzyol
Copy link
Author

Oh, I can't see <div class="statusbar-overlay"></div> in the native webview. But according to your explanation about pages without navbar your approach is right.

But it still can't detect the native webview :) I'm going to send a PR for this.

@omerduzyol omerduzyol changed the title StatusBar gap should be in Navbar on iOS with UIWebView. StatusBar gap cannot be detected in iOS with UIWebView. Apr 5, 2014
@nolimits4web
Copy link
Member

Ok, with latest updates everything fine, overlay appears?

@omerduzyol
Copy link
Author

Yes, everything is well. I also removed my old fork and re-forked again for future updates. :)

Thanks!

@nolimits4web
Copy link
Member

Ok, great;)

@bigruben
Copy link

So does this help me if l am using iPhone 4s

@lock lock bot added the outdated label Jun 26, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Jun 26, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants