7
A
回答
6
當用戶進行刷卡操作
只需將這個在您的CustomCell
- (void)willTransitionToState:(UITableViewCellStateMask)state
{
[super willTransitionToState:state];
if ((state & UITableViewCellStateShowingDeleteConfirmationMask) == UITableViewCellStateShowingDeleteConfirmationMask)
{
for (UIView *subview in self.subviews)
{
if ([NSStringFromClass([subview class]) isEqualToString:@"UITableViewCellDeleteConfirmationControl"])
{
UIImageView *deleteBtn = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 64, 33)];
[deleteBtn setImage:[UIImage imageNamed:@"arrow_left_s11.png"]];
[[subview.subviews objectAtIndex:0] addSubview:deleteBtn];
}
}
}
}
你不應該這個方法將被調用嘗試一下,你不應該改變蘋果的默認意見。
-1
試試這個:
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{
if (editingStyle == UITableViewCellEditingStyleDelete)
{
// Your Code
}
}
12
如果您只需要更改按鈕的標題,則只需添加titleForDeleteConfirmationButtonForRowAtIndexPath方法。
- (NSString *)tableView:(UITableView *)tableView titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath {
return @"NewButtonName";
}
+0
對我來說這真是太棒了:)謝謝! – slboat
相關問題
- 1. UITableView自定義刪除按鈕功能
- 2. 自定義刪除按鈕uitableview iphone sdk
- 3. jqGrid中的自定義刪除按鈕
- 4. UITableView刪除按鈕
- 5. UITableView - 刪除按鈕
- 6. UITableView滑動以刪除:如何自定義按鈕和操作?
- 7. 爲uitableview創建自定義刪除按鈕
- 8. 在UITableView中刪除按鈕
- 9. UITableViewCell的自定義刪除按鈕
- 10. 在UITableview中自定義編輯按鈕
- 11. 自定義GridView刪除按鈕
- 12. 在UITableView後面的自定義UIView中刪除按鈕的問題
- 13. 定製和自定義刪除按鈕爲自定義UITableViewCell
- 14. uitableview單元格中的自定義刪除按鈕不起作用
- 15. uitableview重置刪除按鈕
- 16. 顯示UITableView中的刪除按鈕
- 17. 刪除UITableView中的編輯按鈕
- 18. iOS自定義UITableView單元格按鈕
- 19. 自定義UITableView編輯按鈕
- 20. 自定義清除按鈕
- 21. 單擊自定義刪除按鈕時刪除UITableViewCell
- 22. UITableView編輯模式 - 自定義減號刪除按鈕的顏色
- 23. 從UITableView中刪除編輯按鈕?
- 24. 如何在UITableView的滑動刪除手勢中提供自定義刪除按鈕?
- 25. 通過單擊按鈕從表中刪除自定義的行
- 26. C#中的自定義按鈕:如何刪除懸停背景?
- 27. 用自定義表格單元格中的按鈕刪除行
- 28. 自定義UITableViewCell中的默認刪除按鈕和圖標
- 29. 刪除行中的UITableView,但不使用刪除按鈕
- 30. UITableView下面的一行刪除按鈕
嘗試這些http://stackoverflow.com/q/8603431/194544 http://stackoverflow.com/q/1615469/194544 – beryllium
@beryllium所以你的建議是創建一個自定義單元格?但我已經建立了單元格,我寧願設置一個手勢識別器,然後將其作爲自定義單元格。 – Spire
你想要刪除按鈕的動作,或者你需要更改刪除按鈕 –