iPad simulator 6.0 page orientation not working - xcode

I recently upgraded xcode to 4.5 which installed iPad 6.0. Now when I run PhoneGap html5 app in it the page inside simulator is not rotating, it was working with earlier version of xcode. When I change simulator from portrait to landscape the html page of app remains in portrait, it does not rotate to landscape with simulator.

This solution worked for me:
Edit AppDelegate.m:
Find:
[self.window addSubview:self.viewController.view];
replace with the following code:
self.window.rootViewController = self.viewController;
If you're still displaying the statusbar then inside:
MainViewController.m:
After
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
add
self.webView.frame = CGRectMake ( 0, 15, self.view.frame.size.width, self.view.frame.size.height-15);
Might not be the best fix, but it worked for me!

Related

UIScreen mainScreen bounds different between simulator and actual device on iOS8

in my iOS7 app I use:
screenRect = [[UIScreen mainScreen] bounds];
screenWidth = screenRect.size.width;
screenHeight = screenRect.size.height;
I then use screenHeight for loading different view regarding if device is iPhone 4 or iPhone 5.
The main problem is, when I was checking the app for iOS 8 the simulator return exchanged values in landscape orientation so screenHeight vas actually screenWidth and it loads the wrong view. Ok I solved that, but we did not put any updates yet on App Store, because application is working just fine on actual device with iOS 8. It loads a proper view.
The actual device with iOS8 on landscape return values as before on iOS7, but on simulator iOS 8 the values are exchanged as they should be. Now it is very hard for me to decide if I put an update or not.
Does anybody know what is happening?
Thank you, Matej
Screen co-ordinates are now orientation based in iOS8. Review the session 214 from WWDC 2014 for more info: "View Controller Advancements in iOS 8"
Quote from the presentation:
UIScreen is now interface oriented:
[UIScreen bounds] now interface-oriented
[UIScreen applicationFrame] now interface-oriented
Status bar frame notifications are interface-oriented
Keyboard frame notifications are interface-oriented

Xcode 5 — wrong interface on a device with iOS7

My setting for the project:
Deployment target: iOS6.1
Base SDK: 7.0
IB Document: Opens in 5.0
When I run app in simulator(7.0) I see almost what I expect (I don't understand why barbuttons don't use color tint — on previous screen it shows blue):
But if app is running on a device (also 7.0),
Then I see:
As you can see this is some kind of iOS6 UI, but tableview goes under the navbar, which became transparent.
Why does it happen?
Behavior of tintColor for bars has changed on iOS 7.0, please check the image below:
So now to change the tint color for your bar buttons you need to use tintColor which is the color for the interactive elements within a navigation bar including button images and titles.
While barTintColor is the background color of the UINavigationBar.
So basically
For buttons and title:
[[UINavigationBar appearance] setTintColor:[UIColor grayColor]];
For bar tint:
[[UINavigationBar appearance] setBarTintColor:[UIColor lightGrayColor]];
For the tableVIew under the navBar part, set navigationBar.translucent = NO;
I enabled Autolayout in IB, and now it uses iOS7 on a device too.
Upd.: After some time it start show strange design again. It gone only after I set iOS7 as base and deployment SDK.

iOS 6: UIView transform animation, no animating happening on device working on simulator

I have created an application iOS 6 targeted to iOS 5. The animation is working fine on simulator but giving problem on device having iOS 5. Please suggest me something. Thanks in advance.
code :
[UIView animateWithDuration:0.5 animations:^{answerImageView.transform = CGAffineTransformScale(imageView.transform, 0.0f, 0.0f);} completion:^(BOOL finished){ if(finished) NSLog(#"Finished !!!!!!");}];
Autolayout really messes with animations. Try disabling autolayout.

EAGLView with CGAffineTransform problem on iOS 4.3

I have a weird problem with OpenGL on iOS 4.3.
I have a ViewController with some views and images in the foreground. In the background I have an EAGLView drawn from a CGImage.
When I try to pinch, pan or rotate the EAGLView (not the OpenGL object, just the view) with CGAffineTransform and GestureRecognizer, the view sometimes starts blinking.
On iOS 4.2 and other older iOS versions it works fine.
Can anybody help me?

WebKit won't render on a layer backed view

I have a simple NSView that hosts a WebView.
When I try to make the view layer backed, the WebView stops rendering content - all it renders are the scroll bars.
For simplicity, I added the following code to the applicationDidFinishLaunching method of the app delegate of a brand new xcode project :-
NSView* view = [window contentView];
[view setWantsLayer:YES]; // This is the problematic line!
WebView* webView = [[WebView alloc] initWithFrame:NSMakeRect(0,0,400,400)];
WebFrame* mainFrame = [webView mainFrame];
[view addSubview:webView];
[mainFrame loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:#"http://www.google.com"]]];
If I leave out setWantsLayered the WebKit renders the web page. If I set it, WebKit just renders a white square with scroll bars.
Layer backed WebView's aren't supported. From the Leopard release notes:
Most of the standard views and controls that AppKit and Mac OS X's other Cocoa frameworks provide are able to function in layer-backed mode in Leopard, with the exception of certain specialized views such as WebKit WebViews and Quartz Composer QCViews, whose use in layer-backed mode is not presently supported.
(http://developer.apple.com/mac/library/releasenotes/cocoa/AppKitOlderNotes.html#Animation - Last paragraph of the "New View Animation Facilities, and Layer-Backed View Drawing" section)
You should file a bug with Apple and reference rdar://5270371 as found in this mailing list post http://lists.apple.com/archives/Webkitsdk-dev/2007/Dec/msg00042.html.
This now seems to work.
I have just tried out the same code on Mountain Lion and all is OK.

Resources