I'm placing a UISwitch
es in UITableViewCell
s and I try to disable it initially:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
...
self.switch = [[UISwitch alloc] init];
self.switch.enabled = NO;
cell.accessoryView = self.switch;
...
}
In IOS versions prior to IOS5, the (old-looking) switch is disabled and also looks disabled (dimmed) when the view appears.
In IOS5 the (new-looking) switch is disabled alright, I can't flip it, but it does not look disabled at this stage. It has the same brightness as an enabled switch.
If I enable and re-disable it later in the code (NOT in the cellForRowAtIndexPath:
callback), it does look disabled (dimmed).
Am I doing something wrong or is this a bug in IOS5?
No comments:
Post a Comment