2012-03-06 113 views

回答

0

您可以随时制作自己的图片按钮。选择类型Custom并选择图像作为您的按钮。不要忘记选择突出显示的图像以获得最佳用户体验。

0

如果你是指的tableView删除按钮,这里的伎俩,

下面的代表将被称为第一当你刷卡的动作,

- (void)tableView:(UITableView*)tableView willBeginEditingRowAtIndexPath:(NSIndexPath *)indexPath 
{ 
    indexForEdit=indexPath.row; //Store the row index 
    edit=1; 
    [tableView reloadData]; 
} 

然后在的cellForRowAtIndexPath代码如下,

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 
{ 
//Create a custom cell 
if((indexPath.row==indexForEdit)&&(edit==1)) 
    { 
     edit=0; 
     UIButton *customButton = [UIButton buttonWithType:UIButtonTypeCustom]; 
     //Set frame 
     [customButton setTitle:@"Delete" forState:normal]; 
     [customButton setBackgroundColor:[UIColor grayColor]]; 
     [cell.contentView addSubview:customButton]; 
    } 
}