0
我的项目代码生成不同的结果(CMND + B)在的Xcode 5.1.1运行(CMND + R)与模拟器iphone的ios 5 7.1产生以下 模拟器产生不同的Xcode版本
相同的代码建(CMND + b)以xcode的6.1.1运行(CMND + R)与模拟器iphone 5 IOS 7.1产生以下
- 在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;}];
}