【发布时间】:2013-07-23 15:54:35
【问题描述】:
我有一个自定义的UITableViewCell 和一个红色的UIView,当我选择UITableViewCell 时它变成透明的。
我不希望这种情况发生。有没有办法在选择时保持UIView 的颜色?
仅关于该视图的配置。
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *kCellIdentifier = @"Cell Identifier";
DetailsCell *cell = (DetailsCell *) [tableView dequeueReusableCellWithIdentifier: kCellIdentifier];
if (cell == nil)
{
NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"DetailsCell" owner:self options:nil];
cell = [nib objectAtIndex:0];
}
cell.myView.layer.cornerRadius = 5;
cell.myView.layer.masksToBounds = YES;
return cell;
}
【问题讨论】:
-
你可以添加你的代码吗?
-
代码添加到问题
标签: ios uitableview custom-controls selection