开发者

UIPanGestureRecognizer is working for only uiview not for uiimageview

Can anyone give me the exact reason why the UIPanGestureRecognizer in not working for UIImageView and working for UIView I didnt find any blog. Below is my code(working now)

UIView *endImage=[[UIView alloc]init];

    endImage.backgroundColor=[[UIColor yellowColor] colorWithAlphaComponent:0.3f];
    UIPanGestureRecognizer *panOnEndImage = [[UIPanGestureRecognizer alloc] initWithTarget:self a开发者_StackOverflow社区ction:@selector(handlePanOnLine:)];

    panOnEndImage.delegate=self;
    [endImage addGestureRecognizer:panOnEndImage];
    [anotherUIView addSubview:endImage];
    [panOnEndImage release];

if i am changing endimage as a UIIMageView object then that panning is not working...Thanks in advance your suggestion is more important.


Please add this line and try. [endImage setUserInteractionEnabled:YES]; so this is the answer.(right ;)!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜