【发布时间】:2013-09-20 08:30:29
【问题描述】:
我需要将 alpha 更改为 selectedBackgroundView 的 UITableViewCell。所以我做了以下事情:
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
cell.selectionStyle = UITableViewCellSelectionStyleBlue;
UIView *bgView = [UIView new];
bgView.backgroundColor = [UIColor redColor];
bgView.alpha = 0.5;//This setting has no effect
cell.selectedBackgroundView = bgView;
}
以红色选择单元格,但 alpha 设置对 bgView 无效。
【问题讨论】:
标签: ios objective-c uitableview