2014-06-16 10 views
0

테이블과 사용자 지정 셀이 NIB에서 있습니다. 기본적으로 필요한 것은 사용자 정의 셀을 테이블에서 오른쪽으로 밀어내는 것입니다. 그것은 부드럽고 테이블 자체가 붕괴되어서는 안됩니다. (셀은 작업이 완료된 후 다시 돌아옵니다). 몇 개의 섹션과 1 개의 행/섹션이 있으므로 기본적으로 섹션과 함께 이동해야합니다. 답변 해 주셔서 감사합니다.UITableView 셀에 panMovement를 추가하는 방법

내 cell.m 파일은 다음과 같다 :

#import "MIKETableViewCell.h" 

static NSString *CellTableIdentifier = @"MIKETableViewCell"; 

@implementation MIKETableViewCell 

@synthesize timeLabel = _timeLabel; 
@synthesize priceLabel = _priceLabel; 
@synthesize infoLabel = _infoLabel; 


- (void)awakeFromNib 
{ 
    // Initialization code 
} 

-(id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString*)reuseIdentifier { 
self = [super initWithStyle:style reuseIdentifier:CellTableIdentifier]; 

return self; 
} 

- (void)setSelected:(BOOL)selected animated:(BOOL)animated 
{ 
    [super setSelected:selected animated:animated]; 

// Configure the view for the selected state 
} 


@end 
+0

는 당신이 이것을 달성하기 위해 이미 아무것도 시도? – JoeFryer

+0

IB에 panMovement 액션을 셀에 넣으려고했습니다. ViewController의 뷰에서와 동일하지만 작동하지 않았으며 튜토리얼에서 다른 솔루션을 시도했지만 나에게 도움이되는 것은 없습니다./일부 기본 기능이 누락되었습니다. – user3573289

답변

0

이 추가 :

-(void)layoutSubviews 
{ 
    UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tableCellClicked)]; 
    tapGesture.numberOfTapsRequired = 1; 
    [self addGestureRecognizer:tapGesture]; 
} 
+0

더 많은 점을 알려주세요. 특유한? 내 코드에 표시 할 수 있습니까? 고마워요 – user3573289

+0

- (id) initWithStyle : (UITableViewCellStyle) 스타일 reuseIdentifier : (NSString *) reuseIdentifier가 코드에서 호출되고 있습니까? –

+0

예, 위 코드 샘플을 볼 수 있습니까? – user3573289

관련 문제