我希望能够将描述性文字放在标签下面。以下是我到目前为止的代码:
UISwitch *toggle = [[UISwitch alloc] init];
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:@"Cell"];
cell.textLabel.text = @"Remote Execution";
cell.detailTextLabel.text = @"Remote execution will permit registered devices to execute tests without manually starting them";
[cell addSubview:toggle];
cell.accessoryView = toggle;
[cell.detailTextLabel setAlpha:1.0];
[cell.detailTextLabel setTextColor:[UIColor redColor]];
答案 0 :(得分:1)
使用UITableViewCellStyleSubtitle
代替UITableViewCellStyleValue1
:
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"Cell"];