是这个代码未来证明自定义EKEventViews的颜色(代码附加)

时间:2011-10-25 01:57:14

标签: iphone ios ekevent ekeventkit

这个代码将来是否可以自定义EKEventViews的颜色(代码附加)?也就是说它应该是苹果公司的IOS​​版本。

如果没有,你会推荐什么代码?

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {   
    self.detailViewController = [[EKEventViewController alloc] initWithNibName:nil bundle:nil];         
    detailViewController.event = [self.eventsList objectAtIndex:indexPath.row];
    [self.navigationController pushViewController:detailViewController animated:YES];

    // CODE UNDER QUESTION HERE
    UITableView *tv = (UITableView*)[detailViewController.view.subviews objectAtIndex:0];
    [tv setBackgroundColor:[UIColor yellowColor]];
    UIView *v = (UIView*)[[tv visibleCells] objectAtIndex:0];
    v.backgroundColor = [UIColor greenColor];
}

1 个答案:

答案 0 :(得分:1)

现在完全有效,但Apple随时可能会更改UITableViewEKEventViewController的结构,从而破坏您的自定义设置。尝试查看新的tintColor属性。另外,你在哪里与表视图交互?你不是只是把它呈现出去,对吗?因此,你可以在哪里改变它。我需要更多代码才能提供帮助。您也可以设置[detailViewController.view.subviews objectAtIndex:0].backgroundColor' to [UIColor yellowColor]`等。