当然可以.
有两种方法可以实现这一目标:
UITableViewCell的selectedBackgroundView和selectedTextColor性能UITableViewCell并实现drawInRect和setSelected:animated:方法后一种选择为您提供了更大的灵活性和更好的性能,但如果您以前没有使用过CoreGraphics,可能会稍微困难一些.
更新回应OP的评论:
以下是您可以使用该selectedBackgroundView属性的方法:
UIView *bgView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 60)];
[bgView setBackgroundColor:[UIColor redColor]];
[cell setSelectedBackgroundView:bgView];
[bgView release];
Run Code Online (Sandbox Code Playgroud)
我自己没试过,但它应该有效.
| 归档时间: |
|
| 查看次数: |
2267 次 |
| 最近记录: |