Reduce the width of the UITableViewCell and set the custom button on the left

Is there a way to reduce the standard width of a grouped UITableViewCell and put a custom button on the left side (outside the cell border)? I tried to resize the cell, but it did not change.

alt text

+3
source share
3 answers

You will have to fake the editing mode. What I mean is that, as AtomRiot said, you have to subclass UITableViewCell so that in edit mode you show the button you want on the left, outside the cell.

But first, first. To change the indentation level for your cells, you need to implement this delegation method for a UITableView

- (NSInteger)tableView:(UITableView *)tableView indentationLevelForRowAtIndexPath:(NSIndexPath *)indexPath

, . UITableViewCell , ,

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

, , , , , . ( , ) , . , . !

+2

UITableCell . , . , tableview, .

0

Source: https://habr.com/ru/post/1750951/


All Articles