Note that there are some explanatory texts on larger screens.

plurals
  1. POtextfield disappearing when keyboard present for scrollview
    primarykey
    data
    text
    <p>i have a problem with keyboard appearing in UiscrollView.</p> <p>i added a UIScrollview as</p> <pre><code>scrlView=[[UIScrollView alloc] initWithFrame:CGRectMake(10, 140, 1000, 600)]; scrlView.scrollEnabled=YES; scrlView.showsVerticalScrollIndicator=YES; scrlView.bounces=NO; </code></pre> <p>to this scrollView i have added 10 rows of UITextFields each row has 5 textFields each textfield height is 50px. When ever trying to edit textfield it is overlapping by keyBoard.For that i tried this code</p> <pre><code>[[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]; } </code></pre> <p>}</p> <p>// Called when the UIKeyboardWillHideNotification is sent</p> <pre><code> - (void)keyboardWillBeHidden:(NSNotification*)aNotification { UIEdgeInsets contentInsets = UIEdgeInsetsZero; [UIView animateWithDuration:0.4 animations:^{ scrlView.contentInset = contentInsets; }]; scrlView.scrollIndicatorInsets = contentInsets; } </code></pre> <p>But the textField not appearing on the keyboard.it appearing at the scrollview ypoint position</p> <p>help me on this problem.I saw many answers in StackOverFlow.But not cleared my problem</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload