2015-02-10 27 views
0

我的项目代码生成不同的结果(CMND + B)在的Xcode 5.1.1运行(CMND + R)与模拟器iphone的ios 5 7.1产生以下 enter image description here模拟器产生不同的Xcode版本

相同的代码建(CMND + b)以xcode的6.1.1运行(CMND + R)与模拟器iphone 5 IOS 7.1产生以下 enter image description here

  • xcode中运行6.1.1与模拟器iphone 5 IOS 8.1看起来细(像第一图像从xcode的5.1.1)

任何想法?

这是用于显示键盘的代码:

- (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;}];  
} 

回答

1

尝试按⌘-K而在模拟器切换软键盘。

你也可以找到它的菜单:

硬件>键盘>切换软件键盘

编辑:这是一个pretty popular question

相关问题