开发者

Custom button for edit state of UITableView

开发者 https://www.devze.com 2023-03-27 05:58 出处:网络
The stan开发者_高级运维dard behaviour for the editing state of a UITableView is to show a red minus, which when tapped brings up a delete button. Is there a way to customize this, whereby the minus bu

The stan开发者_高级运维dard behaviour for the editing state of a UITableView is to show a red minus, which when tapped brings up a delete button. Is there a way to customize this, whereby the minus button is a custom one, and the 'delete' confirmation does not appear?


To remove or change (but still use a standard editing accessory), use:

cell.editingAccessoryType = UITableViewCellEditingStyleNone;

To provide your own image/view, use:

cell.editingAccessoryView = yourView; //yourView can be an UIImageView


You could customize the whole edit process: Add a edit-Button to the nav bar. Add an action. On action change the appearance of the cells as you like. Call reloadData.

0

精彩评论

暂无评论...
验证码 换一张
取 消