I have storyboard as below.
Here I am giving option as English or Arabic.
When I run on 4s screen (iOS 7), it looks like below.
When I click on English, I see the scrollView.
In Appdelegate.m, I have
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.
if (IS_DEVICE_RUNNING_IOS_7_AND_ABOVE()) {
NSLog(@"This is iOS 7 iphone...");
[[UIApplication sharedApplication] setStatusBarStyle: UIStatusBarStyleLightContent];
NSLog(@"self.window.frame.size.width==%f", self.window.frame.size.width);
NSLog(@"self.window.frame.size.height==%f", self.window.frame.size.height);
background = [[UIWindow alloc] initWithFrame: CGRectMake(0, 0, self.window.frame.size.width, 20)];
background.backgroundColor = [UIColor whiteColor];
[background setHidden:NO];
self.window.clipsToBounds = YES;
self.window.frame = CGRectMake(0,20,self.window.frame.size.width,self.window.frame.size.height-20);
NSLog(@"self.window.frame.size.height==%f", self.window.frame.size.height);
self.window.bounds = CGRectMake(0, 0, self.window.frame.size.width, self.window.frame.size.height);
}
return YES;
}
All this works smoothly
Now let me run this on iOS 6, iPhone 4s.
Yuckk!!! All things shift down.
Below is what I see (its ugly, isn't it?)
(this image is edited image as the iPhone I am using is mine friend iPhone and I don't want to access his photos :D :P (top status bar is black in iPhone)).
Any reason why this is happening?
Note : Autolayout is ON & I want it active and hence I cannot use delta part
The problem is not about UIPickerView. The problem is UIView gets shifted down and there is white space. If I click on English, I see UIPickerView at its right place. The only problem is view is getting shifted.
I solved it by adding constrains in yellow image
I solved my problem by adding CONSTRAINTS for yellow image.
This is something weird but it happened to me.