Friday 15 May 2015

ios - UITableView does not scroll cell to visible after UITextField becomes first responder -


I have been a UITableView loaded with custom code. There are two possible states of those cells: a reading-only state and a version state. (UITableView *) tableView didSelectRowAtIndexPath: (NSIndexPath *) indexPath {CustomClass * aCustomClass = [Self- (zero) tableView

 : I change between the two lines by tapping the related row in the table view . Model ObjectAntx: IndexPath.ro]; [ACustomClass setEdition: Yes]; [Tableview reloader RAUT & XEPath: @ [IndexPath] with Row Animation: UITWWWWEIN AnimationNone]; }   

The problem is that I followed to exploit because the line needs to be UITextField sets the cell First Responder add the following code went by me :

  - (UITableViewCell *) tableView: (UITableView *) tableView cellForRowAtIndexPath: (NSIndexPath *) indexPath {cell = [tableView dequeueReusableCellWithIdentifier: @ "MyCell"]; If (! Cell) cell = ... // create cell ... [be cell.textfield beforsponder]; }   

All work well, but when UITextField returns the first response, then I want to scroll the table view into the whole scene. For that, I applied such a keyboard notification event:

  - (minus) keyboardWillBeShown: (NSNotification *) aNotification {NSDictionary * info = [aNotification userInfo]; Sijiarti Kebiaraaraarakt = [[information Objektforkiः Uaikeboardfremaendyuesaiaifhaike] Sijiartiavlu]; Sijiariti Swynfram = [Swatabl Vivkvindo Knhwartkhana: Sescateblwukfrem Sedrishy: self.tableView.superview]; // Calculate the area that is covered by the keyboard CGRect cover frame = CGRectIntersection (ownFrame, kbRawRect); Cover Frame = [self.tableView.window ConvertDate: View Frame covered: self.tableView.superview]; UIEdgeInsets contentInsets = UIEdgeInsetsMake (0.0, 0.0, CoverFire, size.height, 0.0); Self.tableView.contentInset = contentInsets; Self.tableView.scrollIndicatorInsets = contentInsets; [Self-TaleviewviewSolartoRoutIndexPath: self OpenSilindApppace PercussionPosition: UITWebScrollPosition Animated: Yes]; }   

The problem is, the table view does not scroll the cell at the top position, as the last line indicates.

If I automate getFirstResponder call and tap UITextField manually, all works fine.

Do you know why this is happening and how can I solve this issue?

Thanks

"itemprop =" text ">

  UIEdgeInsets contentInsets = UIEdgeInsetsMake (0.0, 0.0, CoveredFrame size.high, 0.0);   

should be changed like this:

  UIEdgeInsets contentInsets = UIEdgeInsetsMake (0.0, 0.0, -coveredFrame.size.height, 0.0);    

No comments:

Post a Comment