【发布时间】:2017-08-22 22:14:31
【问题描述】:
在我的viewcontroller,
我添加了我的表格视图 (@IBOutlet weak var MyTableView: UITableView!),其中我添加了几个具有特定大小的自定义单元格,具体大小取决于内部所需的元素。
我用identifier 调用每个单元格:
func tableView(_ MyTableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if indexPath.row == 0 {
let cell = MyTableView.dequeueReusableCell(withIdentifier: "FirstCell") as! FirstCell
self.SettingsTableView.rowHeight = 220
return cell
} else if indexPath.row == 1 { etc etc...
在特定行,我直接在单元格中添加了一个 UIswitch,它应该根据它是打开还是关闭来展开/折叠此单元格。
我想让它工作起来有点像SelectRowAtIndexPath 方法并对其进行动画处理以使其出现在下面的 3 个文本字段......
我正在寻找几个小时的解决方案,如果您有任何想法...欢迎任何建议!
【问题讨论】:
标签: ios swift uitableview uiswitch custom-cell