UiscrollView에 나타나는 키보드에 문제가 있습니다. 키보드가 스크롤 뷰에 대해 표시 될 때 문자 필드가 사라짐
는 난 UITextFields 10 행의 각 행은, 각 텍스트 필드 높이가 50 픽셀이다 5 텍스트 필드를 갖고 추가로이있는 ScrollViewscrlView=[[UIScrollView alloc] initWithFrame:CGRectMake(10, 140, 1000, 600)];
scrlView.scrollEnabled=YES;
scrlView.showsVerticalScrollIndicator=YES;
scrlView.bounces=NO;
같은있는 UIScrollView했다. 이제까지는 UIKeyboardWillHideNotification이
- (void)keyboardWillBeHidden:(NSNotification*)aNotification
{
UIEdgeInsets contentInsets = UIEdgeInsetsZero;
[UIView animateWithDuration:0.4 animations:^{
scrlView.contentInset = contentInsets;
}];
scrlView.scrollIndicatorInsets = contentInsets;
}
를 보낼 때이 코드
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(keyboardWasShown:)
name:UIKeyboardDidShowNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(keyboardWillBeHidden:)
name:UIKeyboardWillHideNotification object:nil];
- (void)keyboardWasShown:(NSNotification*)aNotification
{
NSDictionary* info = [aNotification userInfo];
CGSize kbSize = [[info objectForKey:UIKeyboardFrameBeginUserInfoKey] CGRectValue].size;
CGRect bkgndRect = selectetTxtfld.superview.frame;
bkgndRect.size.height += kbSize.height;
[selectetTxtfld.superview setFrame:bkgndRect];
[scrlView setContentOffset:CGPointMake(0.0, selectetTxtfld.frame.origin.y) animated:YES];
}
} 호출
//을 시도하는 것이 keyBoard.For에 의해 중복되는 텍스트 필드 편집을 시도하지만, 텍스트 필드하지 않는 경우 keyboardview.it는 scrollview ypoint 위치에 나타납니다
이 문제에 대해 도와주세요. 많은 답을 보았습니다. StackOverFlow.But 내 문제를 해결하지 않았다
scrlView.contentInset에서 오류 표시 = UIEdgeInsetMake (0,0, kbSize.height, 0); 호환되지 않는 유형 'int'에서 'UIEdgeInsets'(일명 'struct UIEdgeInsets')에 할당 – sudheer
[scrlView setContentOffset : offSetAfterKeyboardIsDisplayed]에서 오류 표시 '호환되지 않는 유형'CGPoint '(일명'const float ')'const CGFloat ' 'CGPoint 구조체') – sudheer
다시 응답하기위한 tnks입니다. 지금은 내게 매우 중요합니다. – sudheer