在UISplitView控制器中更改根视图控制器的颜色

问题描述:

我想在我的UISplitView控制器中更改RootView控制器左侧的文本颜色和背景颜色。这需要在两个方向上进行。在UISplitView控制器中更改根视图控制器的颜色

+0

是RootViewController的一个UINavigationController,UITableViewController中,其他的东西? RootViewController是在IB还是在代码中设计的?你有什么尝试? – Anna 2010-11-25 00:33:38

要更改文本颜色:

// Dequeue or create a cell of the appropriate type. 
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; 
if (cell == nil) { 
    cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; 
    cell.accessoryType = UITableViewCellAccessoryNone; 
} 

// Configure the cell. 
cell.textLabel.text = [[data objectAtIndex:indexPath.row] retain]; 
cell.textColor = [UIColor blueColor]; //Here you can use whatever color you want 
return cell; 
+0

cell.textColor已弃用,所以请改用cell.textLabel.textColor – willcodejavaforfood 2010-12-07 13:07:03