Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Very interesting discussion thread, i also faced the same problem may be worse one because</p> <ol> <li>I was using a custom cell and the textfield was inside that.</li> <li>I had to use UIViewController to meet my requirements so cant take advantage of UITableViewController.</li> <li>I had filter/ sort criterias in my table cell, ie ur cells keeps on changing and keeping track of the indexpath and all will not help.</li> </ol> <p>So read the threads here and implemented my version, which helped me in pushing up my contents in iPad in <strong>landscape</strong> mode. Here is code ( this is not fool proof and all, but it fixed my issue) First u need to have a delegate in your custom cell class, which on editing begins, sends the textfield to ur viewcontroller and set the activefield = theTextField there</p> <p>// IMPLEMENTED TO HANDLE LANDSCAPE MODE ONLY</p> <pre><code>- (void)keyboardWasShown:(NSNotification*)aNotification { NSDictionary* info = [aNotification userInfo]; CGSize kbValue = [[info objectForKey:UIKeyboardFrameBeginUserInfoKey] CGRectValue].size; CGRect aRect = myTable.frame; CGSize kbSize = CGSizeMake(kbValue.height, kbValue.width); aRect.size.height -= kbSize.height+50; // This will the exact rect in which your textfield is present CGRect rect = [myTable convertRect:activeField.bounds fromView:activeField]; // Scroll up only if required if (!CGRectContainsPoint(aRect, rect.origin) ) { [myTable setContentOffset:CGPointMake(0.0, rect.origin.y) animated:YES]; } } </code></pre> <p>// Called when the UIKeyboardWillHideNotification is sent</p> <pre><code>- (void)keyboardWillHide:(NSNotification*)aNotification { UIEdgeInsets contentInsets = UIEdgeInsetsZero; myTable.contentInset = contentInsets; myTable.scrollIndicatorInsets = contentInsets; NSDictionary* info = [aNotification userInfo]; CGSize kbValue = [[info objectForKey:UIKeyboardFrameBeginUserInfoKey] CGRectValue].size; CGSize kbSize = CGSizeMake(kbValue.height, kbValue.width); CGRect bkgndRect = activeField.superview.frame; bkgndRect.size.height += kbSize.height; [activeField.superview setFrame:bkgndRect]; [myTable setContentOffset:CGPointMake(0.0, 10.0) animated:YES]; } </code></pre> <p>-anoop4real</p>
    singulars
    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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      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