Posts

Post not yet marked as solved
0 Replies
921 Views
Hi, I have a view with a texfield and when the keyboard appears sometimes I get the wrong height. I get the wrong value when I made a long tap in the textfield. With the normal tap I get the correct value. I get the wrong value only on iOS 14 and iOS 15 devices. [[NSNotificationCenter defaultCenter] addObserver:self                 selector:@selector(keyboardWillShow:)                 name:UIKeyboardWillShowNotification                 object:nil]; -(void)keyboardWillShow:(NSNotification *)notification {     if(self.keyboardIsShown) {             return;     }         if (keyboardHeight == 0) {         // grab keyboard size         NSDictionary *userInfo = notification.userInfo;         NSValue *keyFrame = [userInfo valueForKey:UIKeyboardFrameBeginUserInfoKey];         CGRect keyboardFrame = keyFrame.CGRectValue;         keyboardHeight = keyboardFrame.size.height;     }         // move the root view up by the distance of keyboard height     self.view.frame = CGRectMake(self.view.frame.origin.x, self.view.frame.origin.y - keyboardHeight, self.view.frame.size.width, self.view.frame.size.height);         self.keyboardIsShown = YES; }
Posted Last updated
.
Post marked as solved
3 Replies
11k Views
Hi,I have a storyboard-app with several viewControllers and a tabBarController. Up to now the color of the title of the navigationBar was white. Now I'm testing with Xcode 11 beta 6 an iOS 13 beta 8 and the title are black. On devices with iOS 12 the title are still white.I tried to set title color in the navigation bar of the navigation controller in the storyboard. But this makes no difference.I also tried to change the title color in every view, but sometimes it doesn't work.At the beginning of testing with iOS 13 I had to change my code for changing the backgroundcolor of the statusbar. The code is this: self.tabBarControllertitle = NSLocalizedString(@"AppTitle",nil); NSShadow *shadow = [[NSShadow alloc] init]; shadow.shadowColor = [UIColor clearColor]; shadow.shadowOffset = CGSizeMake(0, 1); [self.navigationController.navigationBar setBarTintColor:COLOR_HEADER_LIGHT]; if (@available(iOS 13, *)) { UINavigationBarAppearance *navBar = [[UINavigationBarAppearance alloc] init]; navBar.backgroundColor = COLOR_HEADER_LIGHT; self.navigationController.navigationBar.standardAppearance = navBar; self.navigationController.navigationBar.scrollEdgeAppearance = navBar; } else { UIView *statusBar = [[[UIApplication sharedApplication] valueForKey:@"statusBarWindow"] valueForKey:@"statusBar"]; if ([statusBar respondsToSelector:@selector(setBackgroundColor:)]) { statusBar.backgroundColor = COLOR_HEADER_LIGHT; } } [self.navigationController.navigationBar setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys: shadow, NSShadowAttributeName, FONT_MEDIUM_SIZE_18, NSFontAttributeName, COLOR_TEXT_WHITE, NSForegroundColorAttributeName, nil]];I hope anyone has an idea how to change the title color back to white. Best case without adjust every controller.
Posted Last updated
.