views:

44

answers:

2

Is it possible to have a uitableview that when in editing mode it shows both the red button ('-') and the green button (+) I wanted to do so so i can either delete a row or duplicate it.

A: 

No, to display both you would need to make one of them a custom control.

Probably the best approach is to make a custom cell and add an additional button to the left or right of where the red '-' button usually appears. You can then use a custom graphic that mimics the green '+' button and set it up to trigger on tap.

If you only want it to show in edit mode you can selectively show/hide it based on that too.

The end result will be cells with + buttons and - buttons next to each other.

h4xxr
Alternatively you could make them both a custom control - that might end up looking nicer.
h4xxr
A: 

You can set such a view for

Look through UITableViewCell class reference. There is an editingAccessoryView propery that is most suitable for that particular case:

http://developer.apple.com/library/ios/documentation/UIKit/Reference/UITableViewCell_Class/Reference/Reference.html#//apple_ref/occ/instp/UITableViewCell/editingAccessoryView

I'd use a UISegmentedControl with "+" and "-" images for the purpose you've mentioned.

NR4TR