When I run my iOS app designed for Iphone 4S and earlier on the iOS6 4inch retina simulator, I get purple bar underneath the app content with the tab bar at the bottom. The tabs do not respond. I have added the Default-568h#2x launch image which fills up the screen but my content does not resize even though most nibs are set to AutoResize subviews. Also the keyboard does not come up from the bottom when I tap in a text view.
Is the simulator buggy? I thought apps if not modified would run with black bars in place of the extra screen size. With the simulator like this I have no idea how the app would look on an iPhone 5.
Thanks
The UIWindow containing your UITabBarController has a frame size smaller than the iPhone 5 resolution supported in iOS 6.
To resolve this behavior, set the property in Interface Builder of the UIWindow->Size to be Retina 4 Full Screen
Alternatively, to handle this in your code, set the frame to the main screen bounds:
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
Once I did this, my UITabBarController began working again as designed.
Related
I'm developing an app for iOS 7 using Swift. My app has a login view in wich I use an UIImageView to set a background image. Everything works fine but when I test my app on an iphone 4 the status bar moves down the UIIMageView a little, as you can see in this image:
The UIImageView is positioned at y = 0(Align top to superview) and with and align center x equals to 0. The view mode is scale to fill.
The UIViewController that handles this view just control if the phone has internet connection and don't do anything with the UIImageView.
I tried to set the status bar hidden in the info settings of my project, also in the info.plist file and in the appdelegate when the app is launching by using the method setStatusBarHidden, but nothing works.
How I should deal with with the misplacement of the image, I don't care if I have to hide or not the status bar?
I created my application as tabbar application with iphone screens. It works well earlier. Now i want to change my tabbar application to support for iphone3.5 and 4 inch screen (in ios6 and ios7). In past i have designed only single xib for this.
is it possible to support all those screens with single xib? Please help me on this.
Notes:
I have latest xcode5. I have tried autoresizing , but it is very difficult to understand. Because its work for 3.5 inch screen and 4 inch screen in ios6 but view goes out of the screen in ios7.
That's not because of the size.
In iOS7 both top and bottom bars are transparent.. That's why your views get resized and covered by the bars.
To fix this simply add this lines to your viewDidLoad method:
if ([self respondsToSelector:#selector(setEdgesForExtendedLayout:)])
self.edgesForExtendedLayout = UIRectEdgeNone;
if ([self.tabBar respondsToSelector:#selector(setTranslucent:)])
self.tabBar.translucent = NO;
I have a simple app with multiple UIViews. I've recently begun work to create a universal app out of it get the auto-sizing and rotation of views working with the iPhone 5 and iPad.
On my very first view, the view comes up as the standard 3.5" display with a white bar beneath it on the iPhone 5 (and beside it on the iPad). There is also a toolbar attached to the bottom of the view and it appears at the place where it would be on a 3.5" display. The strange thing is, when I go to another view and then return to the root view, the view is sized correctly.
I've checked my autosizing for the view - all outside and inside anchors are activated. My view mode is set to "scale to fit," and in comparison to other views, settings are the same. And the strange thing is it comes up right the second time the view is displayed.
Any thoughts?
I found my problem. It was in the didFinishLaunchingWithOptions method of the application.
I changed:
UIView *rootView = self.rootViewController.view;
CGRect rootViewFrame = rootView.frame;
rootViewFrame.origin.y +=[UIApplication sharedApplication].statusBarFrame.size.height;
to
UIView *rootView = self.rootViewController.view;
CGRect rootViewFrame = [[UIScreen mainScreen] applicationFrame];
The app was picking up the hard coded size of the view from the XIB when the view first loaded; now I just fit it within the application frame.
I am trying to make a GUI for my first Objective-C application. However, I am kind of stuck at the background.
I need to apply a background which'll work on both iPhone4(s) and 5. How do you do that? I guess resolutions aren't the same on the devices.
There a couple different ways of doing this. One is to create separate storyboards/xibs for each screen size. Another is to use the condition:
if([[UIScreen mainScreen] bounds].height == 568) {
//
}
Or, if your background is a pattern image you only need to apply it once and it will work on both screen sizes, it's as easy as:
[[self view] setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageNamed:#"myImage"]]];
Just create the background image for the size of the iPhone 5 and set the frame for the size of the iPhone 5 as well.
When the app is opened on the iPhone 4 it will truncate the bottom piece of the background-- it won't skew it.
If you are using Storyboards, there is a very useful button in the bottom right corner when the storyboard is open (next to the zoom buttons):
Toggling this will expand/contract your ViewControllers so you can see how it will look for both 3.5 inch (iPhone 4-4s) and 4 inch (iPhone 5) displays.
I have an iPhone app which runs only in landscape orientation. There is is a button on the right side of the screen and one to the far left.
The bottom on the left side work and responds to touches. However, the button on the right side does not respond to touches.
If I display another view and return back to the main view all buttons work.
If I move the button to just before the 3/4 mark on the screen the button works.
If I run the app using the iOS 4.3.2 simulator the buttons work as well.
I am stumped on why buttons just past the 3/4 mark on the landscape screen are not responding.
The app was originally written using xCode 4.1 and iOS 4.3.2. I have opened the project in the new xCode and iOS SDK and this behaviour started.
Specified the frame size for the view in the AppDelegate code before adding it to the MainWindow.
Add the code before adding the view.
viewMgrClass.view.frame = CGRectMake(0.0, 0.0, 480.0, 320.0);
It goes before this line:
[window addSubview:viewMgrClass.view];
I could not figure out how to the MainWindow to be portrait.