Note that there are some explanatory texts on larger screens.

plurals
  1. POHow can you style the default delete button in objective-c ios5?
    primarykey
    data
    text
    <p>I need to style the default delete button on a tableview cell in objective c, ios5. The general idea is the assumption that you can do something like this:</p> <pre><code> UIImage *addImage = [UIImage imageNamed:@"greenButtonDark.png"]; UIButton *addButton = [UIButton buttonWithType:UIButtonTypeCustom]; addButton.frame = CGRectMake(0, 0, addImage.size.width, addImage.size.height); [addButton setImage:addImage forState:UIControlStateNormal]; [addButton addTarget:self action:@selector(pushAddItem) forControlEvents:UIControlEventTouchUpInside]; UIBarButtonItem *addBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:addButton] ; self.navigationItem.rightBarButtonItem = addBarButtonItem; </code></pre> <p>The above code is called in the viewDidLoad method and overwrites the right button in the header. I assume there is something comparable for any button the system adds by default but I don't know how to access this particular one.</p> <p>If I am failing to articulate this, the delete button I refer to is the one automatically generated with this code...</p> <pre><code>- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { if(editingStyle == UITableViewCellEditingStyleDelete) { //do something when someone hits delete } } </code></pre> <p>If I need to clarify anything let me know. Thanks.</p> <p><img src="https://i.stack.imgur.com/5edvK.png" alt="enter image description here"></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.
 

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