【发布时间】:2017-02-12 00:21:19
【问题描述】:
我在UITableViewCell 中有一个UIImageView,当我选择cell 时,imageView 会像这样改变它们的位置:
这是 iOS 的错误还是我做错了什么?
编辑:didSelectRowAt 代码:
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let list = indexPath.section == 0 ? subscribed****s : other****s
if (list == subscribed****s) {
// Removed line that was setting a variable inside a class
performSegue(withIdentifier: "segueNameRemoved", sender: self)
} else {
if (array.contains(removedValue)) {
// Removed line that was setting a variable inside a class
performSegue(withIdentifier: "segueNameRemoved", sender: self)
} else {
// TODO
// This is where the code ended and the image position was changed
}
}
}
【问题讨论】:
-
能否请您展示一些您的代码。特别有用的是您在
UITableViewDelegate方法中拥有的内容:didSelectRowAt -
@Pierce OP 使用该方法编辑
-
如何将 imageView 添加到 tableViewCell 中?它只是一个附件视图吗?
-
@KawinP。图像视图通过情节提要添加到单元格中。
-
你是否为那个 uiimageview 添加了约束?
标签: ios swift uitableview uiimageview tableviewcell