I got a strange problem. You can see the two attached screenshots. The problem is the defects, unknown white rectangular defects. Some part of the keyboard even disappeared in the second screenshot.
Testing with device is the same problem…
Anyone knows what might be the reason? Thanks lot.
textFieldDidBeginEditing
- (void)textFieldDidBeginEditing:(UITextField *)textField{
DEBUGLog
if (!isIPAD) {
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.3];
if (!viewFrameUp) {
viewFrameUp=YES;
self.navigationController.navigationBar.alpha=0;
self.view.frame = CGRectOffset(self.view.frame, 0, -self.navigationController.navigationBar.frame.size.height);
}
CGPoint point = [textField.superview convertPoint:CGPointMake(0, 0) toView:maintable];
CGPoint contentOffset = maintable.contentOffset;
contentOffset.y=point.y-10.0-self.navigationController.navigationBar.frame.size.height; // Adjust this value as you need
[maintable setContentOffset:contentOffset];
[UIView commitAnimations];
}
if ([cellTextFields indexOfObject:textField]==0) {
[keyBoardControl setEnabled: NO forSegmentAtIndex:0];
[keyBoardControl setEnabled: YES forSegmentAtIndex:1];
} else{
[keyBoardControl setEnabled: YES forSegmentAtIndex:0];
[keyBoardControl setEnabled: YES forSegmentAtIndex:1];
}
}


For anyone happened to come to this problem. I found the reason: I used the following CALayer’s properties together to apply on the view’s layer, which doesn’t make any sense and cause me this UI problem…”masksToBounds:YES” shouldn’t be used together with the shadows.