How to indent between row in a table? Found only indent between section. It is necessary that the elements can be clicked. I did this: the cell did with the indentation, threw a smaller view on it, and threw a button on the view. But because of the button the table does not scroll.

Attached the screen of the prototype cell. Tell me, please, otherwise I am stuck right on it.

cell prototype photo

  • I do not understand how the button is associated with the missing scrolling in the table? - surfrider

1 answer 1

You do everything right with the indent, this is the right approach. The concept of "distance between cells" in ios is simply not there (you can only adjust whether there will be a separator between them, but it is of a fixed height and you can only influence its style).

The second problem with the fact that the button in the cell steals the scrolling is treated like this: self.tableView.scrollView.canCancelContentTouches = YES; or the same can be set in the visual editor, the property on the table is called "Cancellable content touches" - it must be enabled.

If this does not help, you need to create a new class, inherited from the UITableView, and assign it to the visas. editor on your spreadsheet:

 @interface MyTableView: UITableView @end @implementation MyTableView - (BOOL)touchesShouldCancelInContentView:(UIView *)view { return YES; } 

With these two settings, we tell the scrollview of the table whether it can cancel the already active cars and take them away.