【发布时间】:2016-06-24 02:48:22
【问题描述】:
我在 UITableView 中显示动态数据,其中包含复选框按钮。当用户选择复选框按钮时,它将在其下方显示 UIStepper。我不知道如何实现这一点,下面的网址中提到了我的确切要求。 Target To achieve
我刚刚在 UITableView 中显示了数据,如下面的代码中所述。我不知道如何实现这一点,当用户选择复选框时是否应该在每个索引下方添加单元格,或者我应该遵循其他一些好的方法。
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return [getNutrients count];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"NutrientCell";
UITableViewCell *nutrientCell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
nutrientCell.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"texture_bg.png"]];
UILabel *nutrientLabel = (UILabel*)[nutrientCell viewWithTag:1];
nutrientLabel.text = [[getNutrients objectAtIndex:indexPath.row]valueForKey:@"name"];
return nutrientCell;
}
【问题讨论】:
标签: ios objective-c uitableview autolayout storyboard