Can't figure out how to do UITableViewCell with custom mode with animation like this

make swipe on cell so UIPickerView will appear, like delete

I'm thinking I need to do in my controller in this method:

- (void)setEditing:(BOOL)editing animated:(BOOL)animated 
{
    [super setEditing:editing animated:animated];
    [self.tableView setEditing:editing animated:animated];
    //add something here
}

or in my custom cell class:

-(void)setEditing:(BOOL)editing animated:(BOOL)animated

found answer custom editingAccessoryView not working

有帮助吗?

解决方案

You should add UIPickerView to your table cell as a subview

其他提示

Add the custom picker as subview and keep it hidden.when you start editing in the delegate method make the view show by setting hidden property to no

When you are making cell to show in tableview in method -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath here you can add your UIPickerview according to your need to UITableViewCell like this-

[cell.contentView addSubview:pickerView];

hope this helps.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top