开发者

Replace UITableView Delete Button with Segmented Button

开发者 https://www.devze.com 2023-02-18 21:17 出处:网络
I have an UITableView in my application that lets the user quit apps on a remote computer. I would like to let the user to choose from Force Quit or 开发者_开发知识库regular Quit, using the regular \'

I have an UITableView in my application that lets the user quit apps on a remote computer. I would like to let the user to choose from Force Quit or 开发者_开发知识库regular Quit, using the regular 'delete' button. Here's a quick mock-up of what I mean:

Replace UITableView Delete Button with Segmented Button

First of all, is this even possible? Secondly, how would I go about implementing this? I'm guessing something like an UISegmentedControl with the same red tint. I'd love to know that tint too ;)


The first thing I thought is the following: Set the "editing" property of every row to NO, then add an UISwipeGestureRecognizer to the cell and attach to it a selector that spawns your segmented control in the cell. I suggest to create a subclass of the UITableViewCell and override the initWithFrame method.

0

精彩评论

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