I host UISwitch es in a UITableViewCell , and first I try to disable it:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { ... self.switch = [[UISwitch alloc] init]; self.switch.enabled = NO; cell.accessoryView = self.switch; ... }
In versions of iOS prior to iOS5, the (old) switch is disabled, and also turns off (dims) when the view is displayed.
In iOS5 (new), the switch is disabled in order, I can not turn it over, but at this point it does not look disabled. It has the same brightness as the activated switch.
If I turn it on and off again later in the code (NOT in the cellForRowAtIndexPath: , it looks disabled (darkened).
Am I doing something wrong or is it a bug in iOS5?
source share