1
我不知道是否有辦法如何防止UITableViewCell左移,並在編輯表時出現刪除按鈕。我想要自定義彈出窗口出現在按紅圈。有誰知道如何做到這一點?防止UITableViewCell左移,刪除按鈕出現在編輯表
在此先感謝。
我不知道是否有辦法如何防止UITableViewCell左移,並在編輯表時出現刪除按鈕。我想要自定義彈出窗口出現在按紅圈。有誰知道如何做到這一點?防止UITableViewCell左移,刪除按鈕出現在編輯表
在此先感謝。
用will/didTransitionToState代替subviews循環,看起來像這樣(如果你也想支持較老的iOS版本,請在鏈接的問題中使用答案)。這將找到刪除在iOS 7
for (UIView *subview in self.subviews) {
for (UIView *subview2 in subview.subviews) {
if ([NSStringFromClass([subview2 class]) rangeOfString:@"Delete"].location != NSNotFound) {
// Do whatever you want here
}
}
}
可能重複鍵:HTTP://stackoverflow.com/a/15564663/1597744 http://stackoverflow.com/questions/8603431/create-custom-delete -button-for-uitableview –
無法在iOS7上工作 –
防止移動單元格內容的一種方法是關閉單元格xib中的自動佈局。 – Yanchi