首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 其他教程 > 操作系统 >

iOS UItableviewcell 点旋钮修改cell颜色

2013-03-25 
iOS UItableviewcell点按钮修改cell颜色@interface MyTableViewController : UITableViewController {UICo

iOS UItableviewcell 点按钮修改cell颜色

@interface MyTableViewController : UITableViewController {    UIColor *cellColor;}-(IBAction)click:(id)sender;@implementation MyTableViewController    -(IBAction)click:(id)sender{        cellColor = [UIColor redColor];        [self.tableView reloadData];    }    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath    {        // Setup your cell        cell.textLabel.backgroundColor = [UIColor clearColor];        cell.detailTextLabel.backgroundColor = [UIColor clearColor];        cell.accessoryView.backgroundColor = [UIColor clearColor];        cell.contentView.backgroundColor = cellColor;        return cell;    }@end


.


cell.backgroundView = [[[UIView alloc] init] autorelease]; cell.backgroundView.backgroundColor = self.cellColor;

热点排行