UITableViewCell
텍스트 UIColour
(의상 셀)을 변경하면 텍스트가 흰색으로 보이지 않게됩니다. UITableViewCell
을 터치 할 때만 텍스트가 표시됩니다. 을 UITableViewCell
(으)로 설정하면 blackColor
이 아닌 이유는 무엇입니까?TableView 셀 색상을 변경하면 작동하지 않습니다
- (UITableViewCell *)tableView:(UITableView *)tableView
cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell =
[self.tableView dequeueReusableCellWithIdentifier:CellIdentifier
forIndexPath:indexPath];
if (!indexPath.row) {
NSDictionary *dic= [[GlobalData sharedGlobals].categories
objectAtIndex:indexPath.section];
cell.textLabel.text = [dic objectForKey:@"title"]; // only top row showing
cell.textLabel.font = [UIFont fontWithName:@"Arial Rounded MT Bold"
size:22];
cell.textLabel.textColor = [UIColor colorWithRed:177
green:218
blue:229
alpha:1];
//cell.textLabel.backgroundColor = [UIColor colorWithRed:218
green:241
blue:245
alpha:1];
} else {
NSMutableArray *typesOfSection =
[[GlobalData sharedGlobals].typesByCategories
objectAtIndex:indexPath.section];
NSDictionary *type = [typesOfSection objectAtIndex:indexPath.row-1];
NSString *titleOfType = [type objectForKey:@"title"];
cell.textLabel.text = titleOfType;
cell.textLabel.textColor = [UIColor colorWithRed:122
green:181
blue:196
alpha:1];
cell.textLabel.font = [UIFont fontWithName:@"Arial Rounded MT Bold"
size:22];
//cell.textLabel.text = @"check";
cell.accessoryView = nil;
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
}
return cell;
}
그리고이 일을 :
cell.textLabel.textColor = [UIColor redColor];
의 작업 ..
감사하지만이 색상은 처음 사용 된 셀만 색칠합니다. 비어있는 셀이 더 많습니다. 흰색 인 채 있습니다. – Curnelious
다른 색상도 변경하고 싶을 것입니다. 시도해보십시오. [UIColor colorWithRed : 177.0/255.0 green : 218.0/255.0 blue : 229.0/255.0 alpha : 1.0]; – singingAtom