- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我使用一个分组的 UITableView 和实现的 commitEditingStyle 从表中删除一行。 (在我的 UIViewController 中,没有 UITableViewController)。我还使用带有选中图像的自定义单元格。要更改图像,我只需使用它:
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
if (selected) {
self.img_checked.image = [UIImage imageNamed:@"checked.png"];
else {
self.img_checked.image = [UIImage imageNamed:@"unchecked.png"];
}
}
我的问题是,当滑动一行时会根据需要出现“删除”,但它会自动取消选择表格 View 中的所有可见单元格
如何防止 tableview 这样做?
最佳答案
您应该保存选定状态的索引或索引路径,然后在 cellForRow 或 willDisplayCell: delegates 中检查它。您可以通过字典或数组来制作它。第二种方法是将它保存在您在单元格中设置的对象内的单独变量中(如果您这样做的话)。
关于ios - UITableViewCell EditingStyle Delete自动取消选择tableview中的所有可见单元格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36960324/
我开始学习swift和rxswift,我是tableview的一部分 我有这个代码 private func setUpBindings() { table.register(UINi
我创建了一个数组 var subjectsData = [ 主题(名称:“投资”,学期:1),主题(名称:“统计”,学期:1),主题(名称:“Studium Universale”,学期:2)] 和一
我使用一个分组的 UITableView 和实现的 commitEditingStyle 从表中删除一行。 (在我的 UIViewController 中,没有 UITableViewControll
我有一个疯狂的问题。我想在我的应用程序中使用 Swift 在我的 UITableView 中实现“滑动删除”。 一些非常简单的事情,滑动工作正常,但从未显示我的红色删除按钮。 func tableVi
我想在 UITableViewCellEditingStyleDelete 时更改按钮的颜色和文本,我该怎么做?这是我如何调用删除单元格的方法:)谢谢! (void)tableView:(UITabl
每当我将我的表格 View 发送到编辑模式时,我单击单元格旁边的减号按钮,然后删除按钮从右侧滑出。 (这是正常的) 但是,我只有很少的时间可以成功按下此按钮。如果我不这样做,它会很快消失。 我也经常遇
我需要在用户点击删除按钮后离开删除模式。我想显示一些事件指示器并等待服务器对删除操作的响应,然后再实际删除单元格(如果服务器没有响应,则不删除)。我想从委托(delegate)方法执行的这个操作: -
以下代码删除了错误的条目。我有一个显示事件列表的数组。在调试器 indexPath.row 中显示 1(这是我选择删除的条目。但是当 View 刷新时,它删除了条目 4。 func tableView
有人知道如何更改 UITable 单元格减号按钮的背景图像, 我需要更改此按钮 类似于 因为如果你在 iOS6 和 iOS7 之间切换,这个按钮就会改变。 最佳答案 希望对你有帮助 - (void)w
我在删除 UITableView 中的行的概念上遇到了一些小问题。用户删除一行后我不想解雇: [self.tableView deleteRowsAtIndexPaths:[NSArray a
我因一次删除多行的问题而受阻。在按钮上单击我将 tableview 编辑样式设置为 YES。然后我们可以在所有可用单元格旁边看到 deleteAccesoryButton。当我们删除单元格并重新加载数
我有一个 TableView ,我试图在其中执行滑动删除操作。 我正在使用 swift 4 和 Xcode 9。 到目前为止,我有下一个代码,它允许我在滑动时显示删除标签: func tableVie
我想使用附件披露指示器来通知用户点击单元格以更改时间。 我确实将附件类型设置为 UITableViewCellAccessoryDisclosureIndicator在 cellForRowAtInd
我正在使用 TableView 并使用编辑样式 .delete 滑动单元格,但单元格的大小已根据应用程序的要求进行了自定义。删除按钮的高度有点大,我们如何自定义它。 请查看截图: 最佳答案 @aver
该bug的解决方法: 我从我的实现中删除了下面的方法。尽管它有效,但当文档提到它们是为协同工作而构建时,我仍然很想知道为什么下面的方法不适用于我的实现。 func tableView(tableVie
我正在尝试向我的表格 View 行添加第二个滑动按钮,但是当我滑动一行时 editActionsForRowAtIndexPath 没有被调用。尽管我的类(class)同时声明了这两者 overrid
我有以下内容 - class BTTableView: UITableView, UITableViewDelegate, UITableViewDataSource 使用这些方法 -
这是连接到我的 TableView 的所有功能。为什么我不能删除行? 我也在 viewDidLoad override func viewDidLoad() { super.viewDidLo
我是一名优秀的程序员,十分优秀!