2013-03-23 3 views
0

Я реализую ячейку ящика. Я настраиваю его сейчас с помощью некоторых пользовательских кнопок, которые я хочу. К сожалению, кнопки не отображаются.Почему моя кнопка не отображается в моем представлении?

Спасибо за помощь

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 
    { 
     static NSString *CellIdentifier = @"Cell"; 
     HHPanningTableViewCell *cell = (HHPanningTableViewCell*)[tableView dequeueReusableCellWithIdentifier:CellIdentifier]; 
     NSInteger directionMask = indexPath.row % 5; 
     if (cell == nil) { 
      NSLog(@"Cell = nil."); 
      cell = [[HHPanningTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]; 




      UIView *drawerView = [[UIView alloc] initWithFrame:cell.frame]; 

      drawerView.backgroundColor = [UIColor greenColor]; 
      cell.drawerView = drawerView; 
       UIImage *checkImage = [UIImage imageNamed:@"check.png"]; 
       UIButton *checkButton = [UIButton buttonWithType:UIButtonTypeCustom]; 
       [checkButton setImage:checkImage forState:UIControlStateNormal]; 
       [drawerView addSubview:checkButton]; 


       //[checkButton addTarget:nil action:(deleteListItem:) forControlEvents:UIControlEventTouchUpInside]; 



     // Configure the cell... 

    } 

ответ

2

часть, где вы говорите cell.frame, я считаю. Попробуйте сделать CGRectMake(0, 0, cell.frame.size.width, cell.frame.size.height). Я также не вижу, чтобы вы давали рамку кнопке? checkbutton.frame = CGRectMake(...);

0

Вы никогда не устанавливали рамку для своей кнопки

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