textView
이 키보드를 표시하거나 숨길 때 화면을 위아래로 움직이려면 위의 방법으로 초점을 맞출 때 마지막 필드를 볼 수 있습니다.키보드가 표시 될 때 탐색 표시 줄이 보이지 않음
- (void)textViewDidBeginEditing:(UITextView *)textField
{
[self animateTextView: textField up: YES];
}
- (void)textViewDidEndEditing:(UITextView *)textField
{
[self animateTextView: textField up: NO];
}
- (void) animateTextView: (UITextView*) textField up: (BOOL) up
{
const int movementDistance = 130; // tweak as needed
const float movementDuration = 0.2f; // tweak as needed
int movement = (up ? -movementDistance : movementDistance);
[UIView beginAnimations: @"anim" context: nil];
[UIView setAnimationBeginsFromCurrentState: YES];
[UIView setAnimationDuration: movementDuration];
self.view.frame = CGRectOffset(self.view.frame, 0, movement);
[UIView commitAnimations];
}
는 그러나 문제는 그것이 또한 화면이 위로 이동하면 이동 년대 navBar
이 위치는 [self animateTextView: textField up: YES];
사용 후의에서 navBar
을 navBar
제외한 모든 이동하거나 유지하는 방법이 있다는 것입니다?
왜? 왜 이런 생각을하게 될까요? 왜 'UINavigationController'를 사용하지 않습니까? 왜 당신은'beginAnimations :'API를 사용하고 있습니까? 이것은 무엇입니까, iOS/iphoneos 3? –