How to adjust the orientation of UIViewControllerWrapperView (in IOS7)? - uiviewcontroller

Background: The application is an iPad app running in Landscape only. When upgrading the app to Xcode 5 and running in the IOS7 simulator, I noticed that some buttons on the right side of the screen were not fully active. i.e. only a fraction of the left side of the button was clickable.
Observation: Running the same source code in IOS6 and IOS7 simulators, and viewing the view hierarchy using the REVEAL tool, I can see that the dimensions of the UIViewControllerWrapperView (the parent of my top level view controller) are landscape for IOS6 (1024x768), but portrait for IOS7.
I am trying to find a way to set the frame of the UIViewControllerWrapperView to the correct dimensions. In the view controller's viewDidLoad method, I tried to get a reference to self.view.superview, but it returns nil.
Can anybody explain; a) why the UIViewControllerWrapperView's frame is in the wrong orientation when running in IOS7 and not IOS6, and more importantly b) how to make it right?

Are you using a UITabBarController? We were having exactly the same issue and got it working by adding this on the UITabBarController:
- (void)viewDidLayoutSubviews
{
// fix for iOS7 bug in UITabBarController
self.selectedViewController.view.superview.frame = self.view.bounds;
}
Why? check this answer

Related

My site is not loading properly in google app in iPhone12 pro when accessed throw a link

Please help me if you have iphone 12 pro ...
My boos (and some of his customers) has an iPhone 12 pro (ios 14.3) and I don't and yu can't install any apps in iphone simulator so debugging this becomes a nightmare.
This problem is specific to Google's app on iphone and does not happen anywhere else!
copy this link and open it in the google's app https://intaker.co/debug.html, tap on one of the links. The site won't load property, it seems that the screen size is not correct (it's very small)!! the loading widget is displayed on the corner and then everything is squished in the corner ... But now if you refresh the same page or rotate the phone the page renders properly!!!
Has anyone seen anything slimier to this? Do you have a solution?
UPDATE 1 : I put a fixed 100% width/height div in the page hopping to force it to grow but no luck
UPDATE 2 : If link comes from the same domain this problem does not happen!!! try the links in here https://intakerclientqa1.azurewebsites.net/debug.html they point to the same domain
UPDATE 3 : This is only happening when using this app https://apps.apple.com/us/app/google/id284815942
UPDATE 4 : Even after updating the device to 14.4 this is still happening, this is how the site is being rendered :
This happens only the first time and only when arrived from a external link, it works fine if :
link is typed/pasted in the browser
page is refreshed
device orientation is changed

How to emulate Surface Pro 4 in browser

I have a user who is using my web app on a Surface Pro 4. The app doesn't render very well. The best way I can describe it is that it appears the browser window has been resized to a small size and it's trying to bunch stuff up. However, I believe he has his browser maximized.
Since I don't have a Surface, I've been trying to get both Chrome and Edge to emulate the rendering issues. Here's what I've tried:
Edge: Has a preset for the Surface Pro 4. I figured that once I selected this mode I would see the problem. It's actually the opposite situation. I actually have to expand the browser window to multiple displays to be able to see all the content (even the browser scrollbars). I suspect that's due to the Surface having a higher resolution than my PC.
Chrome: No preset for the Surface and I couldn't find anyone who had the specific settings. I tried 2738 x 1834 and all three of the built-in pixel ratios (1.0, 2.0, 3.0). Chrome zoomed out so that it all fit on my screen. It also had no rendering issues. Changing pixel ratio made no difference.
I'll admit that web UI development is not my strong suit. And it doesn't help that I inherited a lot of this code. But I'm really scratching my head here.
If I try to emulate with a phone preset, then I can see rendering issues because the app isn't phone friendly, nor does it really need to be. That seems to suggest the emulation in the browser is working fine. What's left? The only thing I can think is that he must be using some kind of scaling that's messing things up.
Also, I should note that I had a friend with an iPad (Sorry don't know what model) try the app out as well and he also sees the same bad rendering issues. In fact, he thinks it's rendering worse than the Surface.
Edit 1:
I put together a test page that shows the header from our app. It is here: https://app.astrolabe-analytics.com/surfaceTest
Here are screenshots of the various displays being tested:
Here is Surface Pro 4 Hardware - Notice buttons are wrapping
Next one is iPad Hardware (I don't believe it's the pro version)
Then here is the way I have Chrome set up to emulate the Surface Pro
Surface Pro 4 emulation in Edge. Note that I had to extend the browser window onto my second monitor to take the screenshot.
Finally, the standard appearance in Chrome
It seems that the emulation works well on my side. please check the following screen shots:
Edge emulation for iPad,
Edge emulation for Surface Pro 4,
Chrome emulation for iPad:
Chrome emulation for Surface Pro 4:
Besides, I also found that if we resize the browser window (change the width property), if the width is too small, the text will wrap or disappear. Please check this image:
So, I suppose the issue is related to the CSS style, as a workaround, you could try to set fixed width property (or using the min-width property) for the navbar-nav class, also, you could refer to the following links to use Bootstrap navbar styles:
Bootstrap Navbar
Angular Bootstrap navbar

How to Emulate High Res displays for Web layout issues

I have website which is having layout issues on certain devices which I believe I've tracked down to high res displays which also have the display scaling in windows 10 set to 200%. (not 200% in the browser, but in the display settings in the Windows Control Panel)
The problem is I don't have a device which can duplicate the resolution of these devices, which is 2736 x 1824 (it's a MS Surface Pro). Oh yeah, this only happen with Edge...
I know of sites which have VMs which will run different browsers for testing purposes, but I don't know of any which allow you to choose your resolution. Without going out and getting a hold of this specific machine, how else can I debug this issue?
You could create a custom device in the developer console, and simply display it at whatever scale actually fits on your screen. For instance, create a custom device with that particular resolution, then in the developer console on Chrome you can view it scaled down 50% (if your own resolution is 1920x1080) so that the whole thing is visible.
Turned out none of the emulation/scaling options in the dev console would emulate what was really happening. I ended up remoting into the customer's computer so I could do my own debugging on there and resolved the issue.
Seems like Edge v 44 was computing some CSS calc function for a div height incorrectly (off by 1 or 2 pixels) which was making some divs push out and mess up the layout.
The fix was to tweak the CSS so the calculation wasn't required.

Anyway to force landscape mode in iOS7..?

is there any correct solution to force the navigation based view controller to landscape mode in iOS7?
If yes, please give me a correct solution.
Note that iOS 7.
I don't want answer for iOS6 or iOS5
UPDATE:
In my case I have an app with more than 10 view conrollers(with Navigation controller).
thats all supports only portrait mode only except one viewconroller.
That one view controller must change to landscape. Then goto next view controller with portrait mode.
Note: iOS7.

HTML5 camera input strange behaviour in fullscreen

I´m writing a webapp for an iPad with HTML5, JavaScript and jQuery. My users need to take pictures with the build-in camera. For that reason I am using input type="file". This works great in different browsers (Chrome/Safari Mobile) but the problem is that when I add my app to the homescreen and take a photo in lanscape fullscreen mode- iOS brings up the camera from the wrong side. To be clearer iPad in landscape mode camera slides in from the left side(should be from the bottom). It behaves like it was called from portrait mode and the picture has a dark part on the left side. The camera window automatically changes the orientation - I debugged it - twice (0°/-90°). When I finish taking the picture and return to the app it is displayed in portrait mode, even though holding it on landscape mode. And additionally the screen is somehow locked. Thsi behaviour doesen't occure holding the iPad in portrait mode. Anyone an idea how to solve this strange behaviour? I found that question but no answers...