2
目前,我增加了一個排的右側圖標的右側並切換對特定行的選擇的光。的iOS - 添加ToggleSwitch上的TableRow編程
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *SimpleTableIdentifier = @"SimpleTableIdentifier";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:SimpleTableIdentifier];
...
...
NSUInteger row = [indexPath row];
if(row == 3)
{
//Draw bulb in row
cell.accessoryView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"bulb-on.png"]];
//Instead of image, draw toggle-switch here
}
else
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
cell.textLabel.text = [listData objectAtIndex:row];
return cell;
}
我怎樣才能而不是該圖像繪製一個可用的切換開關?