小编Old*_*Dog的帖子

更改细节公开按钮的图像(Xcode 4.2)

我已经使用以下建议的例程来更改表视图单元格中的详细信息公开按钮图像(在tableView cellForRowAtIndexPath中)

if (cell == nil) {

    cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil];

    UIButton *myAccessoryButton = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 24, 24)];
    [myAccessoryButton setBackgroundColor:[UIColor clearColor]];
    [myAccessoryButton setImage:[UIImage imageNamed:@"ball"] forState:UIControlStateNormal];
    [cell setAccessoryView:myAccessoryButton];
    cell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton;
}
Run Code Online (Sandbox Code Playgroud)

但是,tableView accessoryButtonTappedForRowWithIndexPath现在不再单击按钮调用该事件.

谁有任何想法为什么?

xcode uitableview ios5

5
推荐指数
1
解决办法
8269
查看次数

标签 统计

ios5 ×1

uitableview ×1

xcode ×1