UISwitch 详细文字在下方
UISwitch detailed text underneath
我希望能够将描述性文字放在标签下方。以下是我到目前为止的代码:
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]];
使用UITableViewCellStyleSubtitle
代替UITableViewCellStyleValue1
:
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"Cell"];
我希望能够将描述性文字放在标签下方。以下是我到目前为止的代码:
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]];
使用UITableViewCellStyleSubtitle
代替UITableViewCellStyleValue1
:
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"Cell"];