Note that there are some explanatory texts on larger screens.

plurals
  1. POIOS UITableView "Delete" button does not appear
    primarykey
    data
    text
    <p>I am developing app where users can create Posts with attachments. For attachments I have used <code>UITableView</code> and rotated it in horizontal mode in <code>viewDidLoad</code> method as following:</p> <pre><code>// Rotates the view. CGAffineTransform transform = CGAffineTransformMakeRotation(-1.5707963); imageAttachmentTableView.transform = transform; </code></pre> <p>When the user chooses images from Photo Library, they are loaded in UITableView's imageView.</p> <pre><code>- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]; } // Configure the cell... CGAffineTransform transform = CGAffineTransformMakeRotation(1.5707963); cell.imageView.transform = transform; cell.imageView.frame = CGRectMake(0, 0, 110, 110); cell.imageVenter image description hereiew.image = [imageAttachments objectAtIndex:indexPath.row]; return cell; } </code></pre> <p><code>cell.imageView</code> is again rotated in opposite direction so that image should be visible in actual orientation</p> <p>UITableView is made in editing mode so that when the images are loaded, they can also be removed by single tap.</p> <pre><code>- (void)viewWillAppear:(BOOL)animated { [imageAttachmentTableView setEditing: YES animated: YES]; } </code></pre> <p>I have also changed the default "Delete" text to "X"</p> <pre><code>- (NSString *)tableView:(UITableView *)tableView titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath { return @"X"; } </code></pre> <p>The code is working perfectly in Portrait mode as in following screen, when the user taps '-' button 'X' appears.</p> <p><a href="http://img5.imageshack.us/img5/1125/screenshot20121221at742.png" rel="nofollow">http://img5.imageshack.us/img5/1125/screenshot20121221at742.png</a></p> <p>Problem is in Landscape mode, the (-) button appears but 'X' button does not appear. <a href="http://img833.imageshack.us/img833/6305/screenshot20121221at747.png" rel="nofollow">http://img833.imageshack.us/img833/6305/screenshot20121221at747.png</a></p> <p>I have tried all possible solutions, but could not make any stick, please help</p>
    singulars
    1. This table or related slice is empty.
    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.
 

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