我面臨的問題是,有什麼方法可以更改UITableView
中刪除按鈕的默認框架 ,還有一點是,刪除按鈕始終顯示在單元格的中心UITableViewcell
所以任何方式來改變刪除按鈕的框架。iPhone:如何更改UITableViewCell中的默認刪除按鈕的框架
// Update the data model according to edit actions delete or insert.
- (void)tableView:(UITableView *)aTableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle
forRowAtIndexPath:(NSIndexPath *)indexPath
{
if (editingStyle == UITableViewCellEditingStyleDelete)
{
[appDelegate.categories removeObjectAtIndex:indexPath.row];
[categoryTableView reloadData];
}
}
#pragma mark Row reordering
// Determine whether a given row is eligible for reordering or not.
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath
{
return YES;
}
// Process the row move. This means updating the data model to correct the item indices.
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath
toIndexPath:(NSIndexPath *)toIndexPath
{
NSString *item = [[appDelegate.categories objectAtIndex:fromIndexPath.row] retain];
[appDelegate.categories removeObject:item];
[appDelegate.categories insertObject:item atIndex:toIndexPath.row];
[item release];
}
在此先感謝。
請告訴我教程或任何鏈接 –
您的單元格是從xib文件創建還是默認類型之一? – jrturton
我正在創建單元格(CustomCell),它是UITableViewCell的一個子類 –