我在viewController中添加了UIImageView,并附加了pan手势识别器,实现了处理程序,并且它正常工作 . 在customView中尝试相同的方案时会出现问题,从不调用处理程序 . 自定义视图中的UIImage具有用户交互和启用多个Touch,以及主ViewController中的UIView . 请帮忙 .
CustomView是从xib加载的:
@implementation previewView
-(instancetype)initWithCoder:(NSCoder *)aDecoder {
DLog(@"Initializing NDGPreviewViewWithCoder - from XIB");
self = [super initWithCoder:aDecoder];
if (self) {
[self commonInit];
}
return self;
}
- (void)commonInit {
//load the interface file from .xib
[[NSBundle mainBundle] loadNibNamed:@"previewView" owner:self options:nil];
[self addSubview:self.view];
}