简体   繁体   English

如何在iPhone应用程序中将表格视图中显示的文本的颜色从默认的黑色更改为?

[英]How to Change the color of the text present in table view from its default black color in an iphone application?

如何在iPhone应用程序中将表视图中显示的文本的颜色从默认的黑色更改为?

Try this. 尝试这个。

cell.textLabel.textColor=[UIColor blueColor];

You can also give RGB values like 您也可以给RGB值,例如

cell.textLabel.textColor =  [UIColor colorWithRed:200/256.0 green:0/256.0 blue:67/256.0 alpha:1.0];

All the best. 祝一切顺利。

 - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

 static NSString *CellIdentifier = @"Cell";

 UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
 if (cell == nil) 
 {
 cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
 cell.textLabel.textColor = [UIColor yellowColor]; //Change the text color

 }

 // Configure the cell...

 return cell;
 }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用 # iphone 更改表格视图中的文本颜色 - change text color in table view using # iphone 如何在iPhone中更改电话号码默认电话簿应用程序的颜色? - How to change color of phone number default phone book application in iphone? iOS 7:如何在一个视图控制器中将状态栏文本颜色更改为白色,在第二个视图控制器中将状态栏文本颜色更改为黑色? - iOS 7 : How to change the status bar text color as white in one view controller and black in second view controller? 应用程序图标在 iphone 设备上更改其背景颜色 - application icon change its background color at iphone device 更改表格视图中所有单元格的文本颜色 - Change the text color of all the cells in a table view 如何更改UITabbarItem的文本颜色以及如何在iPhone应用程序中添加自定义TabBar? - How to change the text color of a UITabbarItem and how to add a custom TabBar in an iPhone Application? 如何更改表格视图标题的颜色 - how to change color of table view title 如何更改表格视图上的颜色备用单元格 - how to change the color alternate cell on table view 按下时如何更改iPhone上按钮的默认颜色? - How can I change the default color of the button on iPhone when pressed? 如何更改iPhone上按钮的默认颜色? - How can I change the default color of the button on iPhone?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM