Problem:
I used a custom UITalbeViewCell, which contains two buttons, they work fine in portrait orientation. After turning, they all stop responding to a button press inside the function. Some people have problems that their buttons could not draw correctly after rotation. My game looked great, as the buttons appear in the right places after rotation, but they no longer respond to a button click.
For this particular view in my application, I used the UIPageController to implement multiple pages in the view, and for the view (now the name EmbeddedView) built into the page scroll controller, there is a UITableView that contains a custom UITableViewCell. The user cell for viewing the table has only a tip; the owner of the file is EmbeddedView.
in EmbeddedView:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"CellIdentifier"; CustomTableViewCell *cell = (CustomTableViewCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { [[self customTableCellNib] instantiateWithOwner:self options:nil]; cell = [self customTableCell]; [self setCustomTableCell:nil]; } }
What I tried:
I created another nib file for a cell of a custom table view and used it in -cellForRowAtIndexPath (), I checked the orientation and dynamically created the cell using another thread, no luck.
I added [tableview reloadData] to -didRotateFromInterfaceOrientation (), did nothing.
Can someone point me in the right direction, please? Any help is appreciated.
This is a table view of Autosizing in IB:

It looks right, but the buttons do not work

Update: I tried to specify various Autosizing masks in IB to represent the table, and the results are shown below:
<1>



<2>



<3>


<4>

<T411>
source share