我想有一個UITableViewCell揭示特定的細胞更多的內容每當特定的細胞被竊聽。一旦細胞擴大並再次敲擊,細胞應縮回原始大小。如何更改的UITableViewCell的自來水高度?
我敢肯定,代表heightForRowAtIndexPath
和didSelectRowAtIndexPath
需要做些事情,但我不知道如何使用didSelectRowAtIndexPath選擇特定的表格單元格行。
// Height of table cell rows
func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat {
return 45
}
//On cell tap, expand
func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
self.tableView.rowHeight = 75;
}
此外,是否有可能隱藏任何內容是從父細胞溢出?有點像溢出:隱藏;在CSS中。
注意你沒有得到任何的動畫與此解決方案,不像法伊扎的回答 – Joey