You should add UIPickerView to your table cell as a subview
Custom UITableViewCell edit mode
-
31-05-2022 - |
Domanda
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
Soluzione
Altri suggerimenti
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.
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow