How to display red "Cancel" button in UITableViewCell?
I am building a custom UITableViewCell
which will be displayed while the user is downloading data from a web service, and which will include a "Cancel" button to allow them to cancel the UR开发者_运维百科L connection. I'd like to emulate the look-and-feel of the "Delete" buttons which are displayed in the table editing view, like this:
How can I create such a red button which says "Cancel" instead of "Delete" in my custom UITableViewCell
? It appears that the only type of button I can put in a UITableViewCell
is a regular UIButton
(UIBarButtonItem
won't go anywhere except a UIToolbar
), and Interface Builder doesn't give an option to create a red Delete-like button as a standard style.
In the end, I just had to create my own custom UITableViewCell, and use some Photoshop magic to figure out how to make a button that looks exactly like the iPhone Delete buttons, but saying "Cancel." It didn't take that much time.
精彩评论