0
如何更改ios 5.0的xcode4.2中的删除按钮样式?如何更改删除按钮样式?
如何更改ios 5.0的xcode4.2中的删除按钮样式?如何更改删除按钮样式?
您可以随时制作自己的图片按钮。选择类型Custom
并选择图像作为您的按钮。不要忘记选择突出显示的图像以获得最佳用户体验。
如果你是指的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];
}
}
什么删除按钮样式? – BoltClock 2012-03-06 02:17:38
EditTable删除按钮样式我想! – Bala 2012-03-06 04:55:40