2011-12-15 4 views

ответ

2

Один из способов сделать это, чтобы добавить UIStepper к каждой ячейке как подвид в Tableview: cellForRowIndexAtPath в вашем TableViewController. Например:

- (UITableViewCell*) tableView:(UITableView*)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 
{ 
    static NSString* CellIdentifier = @"Cell"; 

    UITableViewCell* cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; 
    if (cell == nil) 
    { 
     cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier]; 

     UIStepper* stepper = [[UIStepper alloc] init]; 
     stepper.frame = CGRectMake(220, 10, 100, 10); 
     [cell.contentView addSubview: stepper]; 
    } 

    return cell; 
} 

Это добавит шагомер в правую часть каждой ячейки вашего стола.

+0

Это не работает для определенных размеров экрана – DaynaJuliana

Смежные вопросы