안녕하세요 모든 사람들이 ios에 상당히 새롭기 때문에 배울 점이 많습니다. 웹 서비스에서 표 셀로의 동적 배경색이있는 하위보기를 추가했지만 하위보기 배경색은 선택되어 있습니다. 표 셀을 선택한 상태 색으로 변경하면 모든 하위보기를 배경 색이보기로 변경하는 이유는 무엇인지 알기 때문에 하위보기 배경색을 변경하지 못하도록 막을 수 있습니다. 선택한 동적 색상으로 유지 되나요?목표 c 하위 뷰 UITableViewCell 배경색 선택시
array = [colors objectAtIndex:indexPath.row];
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell"];
if (cell == nil)
{
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"Cell"];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
UIView *colorBox = [[UIView alloc] initWithFrame:CGRectMake(10,10,20,20)];
[colorBox setTag:1];
[cell.contentView addSubview:colorBox];
}
UIView *box = [cell viewWithTag:1];
box.backgroundColor = [self colorForBox:array.color];
return cell;
는 다음 색상 어떤 도움이 많이 감사 감사하겠습니다
- (UIColor *)colorForTransport:(NSString*)Line {
if([Line isEqualToString:@"Brown"])
return [UIColor colorWithRed:0.682 green:0.38 blue:0.094 alpha:1];
else if([Line isEqualToString:@"Red"])
return [UIColor colorWithRed:0.894 green:0.122 blue:0.122 alpha:1];
else
return DefaultBackgroundColor;
}
을 받고!
내가 질문을 이해하지 않습니다. 너는 무엇을 막으려 고하는거야? – Lefteris