2
現在、ある行の右側にアイコンを追加して、その特定の行を選択すると点灯します。iOS - プログラムでTableRowの右側にToggleSwitchを追加する
-(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;
}
画像の代わりに、使用可能なトグルスイッチを描画するにはどうすればよいですか?