在自定义UITableViewCell上显示隐藏对象显示在备用单元格

时间:2015-08-02 16:37:02

标签: ios objective-c uitableview cocoa-touch

我有一个带有imageView的自定义单元格和在IB中创建的隐藏视图。双击图像我取消隐藏视图。我看到的问题是视图显示在tableview的备用单元格中。如何仅在用户点击的单元格上显示视图。

-(void) addRecognizer {
UITapGestureRecognizer *postGestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(imageTapped:)];
postGestureRecognizer.numberOfTapsRequired = 2;
[self.postImageView setUserInteractionEnabled:YES];
[self.postImageView addGestureRecognizer:postGestureRecognizer];
}

- (void) imageTapped:(UIGestureRecognizer *)recognizer
{
    if(recognizer.state == UIGestureRecognizerStateRecognized)
    {
         [self.headingView setHidden:NO];
    }
}

示例代码STXDynamicTableView

提前致谢

0 个答案:

没有答案