0
ラベルの下に説明文を置くことができます。
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]];
。下の2行に分割する方法はありますか?ありがとう! – Parth
すべてのセルに同じメッセージがありますか?それはたまには1行になることもあれば2行になることもありますか?それとも3行?デバイスが横向きに回転している場合はどうですか?最適な方法は、カスタムセルを作成し、動的高さセルに自動レイアウトを使用することです。 – DonMag
私はちょうどcell.detailTextLabel.numberOfLines = 2を設定しました。 – Parth