A
A
Alexander Tikhonov2015-10-30 15:51:54
Objective-C
Alexander Tikhonov, 2015-10-30 15:51:54

Implement popup menu under TableViewCell, how?

In what way it can be implemented?
While the idea is this - we have a custom cell with a layout constraint (the distance from the bottom of the 1st view to the bottom of the 2nd view), which we save in the cell properties, didselectrowatindexpathwe get the selected cell and change this layout. Any other ideas?
f9b61c18905f469bb64436a86aa8e430.gif

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Tikhonov, 2015-10-30
@tikhonov666

Everything turns out to be much easier.

override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
        selectedIndexPath = tableView.indexPathForSelectedRow
        tableView.beginUpdates()
        tableView.endUpdates()
    }
    
    override func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat {
        if selectedIndexPath == indexPath {
            return 107
        } else {
            return 50
        }
    }

stackoverflow

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question