0

my project code built (cmnd + b) in xcode 5.1.1 run (cmnd + r) with simulator iphone 5 ios 7.1 produce the following enter image description here

same code built (cmnd + b) in xcode 6.1.1 run (cmnd + r) with simulator iphone 5 ios 7.1 produce the following enter image description here

  • running in xcode 6.1.1 with simulator iphone 5 ios 8.1 looks fine (like the first image from xcode 5.1.1)

any ideas?

this is the code for showing the keyboard:

- (void)showKeyboard:(NSNotification*)notification
{
    NSValue *keyboardEndFrameValue = [[notification userInfo] objectForKey:UIKeyboardFrameEndUserInfoKey];
    CGRect keyboardEndFrame = [keyboardEndFrameValue CGRectValue];

    NSNumber *animationDurationNumber = [[notification userInfo] objectForKey:UIKeyboardAnimationDurationUserInfoKey];
    NSTimeInterval animationDuration = [animationDurationNumber doubleValue];

    NSNumber *animationCurveNumber = [[notification userInfo] objectForKey:UIKeyboardAnimationCurveUserInfoKey];
    UIViewAnimationCurve animationCurve = [animationCurveNumber intValue];

    UIViewAnimationOptions animationOptions = animationCurve << 16;

    int searchBarYPadding = 60;
    if ([[UIDevice currentDevice].systemVersion floatValue] >= 7.0f)
    {
        searchBarYPadding = 42;
    }

    [UIView animateWithDuration:animationDuration
                          delay:0.0
                        options:animationOptions
                     animations:^{
                         CGRect textFieldFrame = self.addressSearchBar.frame;
                         textFieldFrame.origin.y = keyboardEndFrame.origin.y - searchBarYPadding;
                         self.addressSearchBar.frame = textFieldFrame;
                     }
                     completion:^(BOOL finished) {isKeyboardDisplayed = YES;}];      
}
liv a
  • 3,232
  • 6
  • 35
  • 76

1 Answers1

1

Try pressing ⌘-K while in the Simulator to toggle the software keyboard.

You can also find it in the menus:

Hardware > Keyboard > Toggle Software Keyboard

Edit: this is a pretty popular question

Community
  • 1
  • 1
cjwirth
  • 2,015
  • 1
  • 15
  • 24