私はiOSプログラミングの初心者であり、私の質問に対する答えを探しています。
UITableViewCell内にUISliderがあり、次の配置を取得しようとしています:Label-Slider-DetailLabel(dynamic)。
これは私のコードです:
cell = [tableView dequeueReusableCellWithIdentifier:@"SelectedMeetingCell"];
[cell.textLabel setText:@"Duration"];
[cell.detailTextLabel setText:[Utilities StringFromDuration:Agenda.InitialDuration.doubleValue]];
sliderCell = (SliderCell*)[[UIViewController alloc] initWithNibName:@"SliderCell" bundle:nil].view;
[sliderCell setDelegate:self];
[sliderCell.slider setValue:Agenda.InitialDuration.doubleValue];
[cell.contentView addSubview:sliderCell];
sliderCell.slider.frame = CGRectMake(100, 0, 500, 44);
最後の行は、スライダーを希望どおりに配置するために使用した方法です。iPadには最適ですが、iPhoneバージョンにはまったく機能しません。デバイスに応じてスライダーの幅を自動的に変更する方法はありますか?
(SliderCellは、UISlider @propertyを持つUITableViewCellです)
よろしくお願いします!