ios Noobはこちら。TableView
各行にいくつかの項目が必要なiOSがあります:UILabel
質問をするための A、[はい] ボタン、[いいえ] ボタン、および「1 から 5 のレート」に答えるスライダー。質問が評価を扱う場合にのみ、スライダーは実際にはすべての質問に表示されるわけではありません。
にすべての「ウィジェット」を追加するための最良の方法は何TableView row
ですか? プログラムまたはストーリーボードを通じて?また、 を使用する場合storyboards
、評価バーを非表示にし、必要に応じて再度表示するにはどうすればよいですか?
コードスニペットで更新
@property (strong,nonatomic) NSMutableArray *ObjQuestions;
...
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
// Configure the cell...
OBJ_Question *q1 = [self.ObjQuestions objectAtIndex:indexPath.row];
cell.textLabel.text = q1.QuestionText;
// need to access second and third Label widgets from storyboard here
// as well as show/hide NSSlider
return cell;
}