I'm developing a universal iOS app for iPhone and iPad. I'm having some trouble with the splitview in the iPad app. In the detailController there's a UIWebView where I load a webpage that should autoresize(that's in the css from the webpage). In portrait it's ok, but in landscape mode, the webpage doesn't resize at all. I also checked the "Scales Page To Fit" button. But this doesn't work either! Is there a way to resize the webpage in safari manually?
Here are some screenshots:
iPad Portrait:
Landscape
Related
I have a responsive website which i tried adding in uiwebview. When testing in the simulator with iphone 5 it displays the website correctly, but when displaying on iphone 6 it leaves about 20px blank.
I have trief different solutions like here; UIWebView dones't resize correctly when orientation change?
But without result.
Is there anyone who can help me on the way?
I have an app that is a single view: a UIWebView that gets pdfs loaded into it. The pdfs are loaded from an ECSlidingViewController.
For some reason, when the app goes from portrait to landscape, the WebView remains in the same position and there is a large dark area to the left of the screen.
Portrait:
Landscape:
I have tried a number of techniques, but they each have problems. For example I can't simply reload a landscape view when the orientation changes, the user will lose their place in the webview. Any ideas?
My app is a simple Master-Detail applciation, based on a Split View Controller (for the iPhone 6+).
The Master View is listing the news of my Web Site, and the Detail View is showing the news, embedded in a UIWebView.
The problem is that the UIWebView is starting under the Navigation Bar, but only on portrait mode. On landscape mode, the UIWebView is correctly displayed. Here 2 screenshots :
Portait mode
Landscape mode
As you can see, the head of our dear French minister is cropped in portrait mode !
Any ideas on how to fix that ?
I have an iOS 5 + app I am getting ready for iOS 7.
I have a standard TabBar based app loading in viewcontrollers, one of which loads in a webView.
This webview has a landscape and portrait mode as the app can be rotated, this works fine on all devices except iPad running iOS 7.
The issue being the webview is always displayed as landscape on iPad on iOS 7 irrespective of the orientation, iOS 7 gets rid of the 2x button that you used to get with iPhone apps running on an iPad so it is faux full screen.
The app opens in portrait mode, if I rotate the iPad everything else rotates - all other views adjust and reposition - except the html in the webview - it is stuck on landscape.
This happens on device and simulator
The question I suppose is why? has anyone else had experience of this?
Many thanks
Try setting constraints on the UIWebView. In the storyboard, look for the menu icons on the bottom right, and select the one that looks like a tie fighter. Then select 'Add Missing Constraints' or 'Reset to Suggested Constraints'. then when your View changes (orientation), the space constraints will adjust.
I've a web application for iphone/ipad. When I view it in mobile safari it appears good both in landscape and portrait mode. But when I open it in my own ipad web app (under uiwebview), it appears good in landscape mode, but contents are cut-off in portrait mode.
How to fix it. Am i supposed to fix it on server side, or in ipad application?
Regards
If it works in Mobile Safari and not in your wrapper app using UIWebView, it is possible that the problem comes from the application, and that your webview is not properly resized when the device rotates to landscape.
Try setting the webview's autoresizingMask as follow in your view setup code :
webView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
or, if you defined your webview in Interface Builder, use the "size inspector" to set the appropriate autoresizing mask (every red line must be selected in the resizing diagram).