Resized UITableView cell frames are not updated

I have a UITableView that I change when the keyboard shows.

// MonoTouch code

// Resize the table so it not hidden by the keyboard
var keyboardFrame = UIKeyboard.BoundsFromNotification(notification);
var tableFrame = myTable.Frame;
tableFrame.Height = theView.Frame.Height - keyboardFrame.Height;
myTable.Frame = tableFrame;

// Bring the current cell back in view
this.InvokeOnMainThread(()=>{
    if(currentCell != null) myTable.ScrollRectToVisible(currentCell.Cell.Frame, true);
});

However, when I try to perform an action in this cell that is sensitive to the current current cell on the screen (for example, attaching a UIPopoverController), I find that the frame of this cell shows its original location before resizing and scrolling the table.

I tried the following, giving the same frame results that still indicate the old location (many of them experimented to see if they had done something without knowing what would work and what wouldn't):

  • Using SetNeedsLayout in a cell, table subzones, tables.
  • Using LayoutIfNeeded in a cell, table subzones, tables, and views containing a table
  • SetNeedsLayout LayoutIfNeeded
  • , ( //),
  • , ,

, , .

, , , , , , . , .

- , UITableView ReloadData (ReloadData )?

+3
1

. UITableView UIScrollView. UIScrollView, , ContentSize. . , ContentSize , "", .

UITableView . ContentMode.

, , ContentSize. , , ContentSize Frame . ContentSize , .

ConvertRectToView ConvertRectFromView, tableview.

+2

All Articles