Search code examples
ipaduitableviewuitextfieldautoresizingmask

iPad - UITableView with UITextField - Autoresizing problem when orientation changes


In my iPad split view application, I've a table view in detailed view as well. Each row has a text field. When orientation changes, the table field in table view is extending out of table view. Can some one tell me how to set the auto resizing mask so that even when orientation changes, the text fields will be within the table view?


Solution

  • if you add tableview as subview of UIView then:

    [self.view setAutoresizesSubviews:YES];
    [tableView setAutoresizesSubviews:YES]; or set in IB
    

    while creation of cell set like this:

    [urcell setAutoresizesSubviews:YES];
    

    if u add textField as subview of cell. So that it will handle all of its subviews while orientation