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

버튼 프레임을 설정하지 마십시오.

관련 문제