Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Well, I've tried many ways to do it, but the most simple was to make a UIButton with a custom style.</p> <p>If you need a "delete" button in the footer of the table - like in contact or event, here is the code:</p> <pre><code> UIView *footerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 60)]; UIButton *newDeleteButton = [UIButton buttonWithType:UIButtonTypeRoundedRect]; newDeleteButton.frame = CGRectMake(10, 10, 300, 43); UIImage *buttonBackground = [UIImage imageNamed:@"ButtonDelete.png"]; [newDeleteButton setImage:buttonBackground forState:UIControlStateNormal]; [newDeleteButton addTarget:self action:@selector(deleteButtonPressed:) forControlEvents:UIControlEventTouchUpInside]; UILabel *deleteTitle = [[UILabel alloc] initWithFrame:CGRectMake(10, 10, 300, 39)]; deleteTitle.text = @"Delete"; deleteTitle.font = [UIFont boldSystemFontOfSize:20]; deleteTitle.textColor = [UIColor whiteColor]; deleteTitle.textAlignment = UITextAlignmentCenter; deleteTitle.backgroundColor = [UIColor clearColor]; [footerView addSubview:newDeleteButton]; [footerView addSubview:deleteTitle]; formTableView.tableFooterView = footerView; </code></pre> <p>First, you create the view for footer. </p> <p>Then you make a button with the correct background — just make a screenshot of any button you need and delete letters from it.</p> <p>Than you create a caption for your button and place it over the button.</p> <p>The last step is to put the button and caption in the footer view, and put the footer view into the table.</p>
 

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