Pass touch from UIScrollView to superview (UIButton)

后端 未结 3 495
囚心锁ツ
囚心锁ツ 2020-12-20 02:44

Possibly a duplicate, but I couldn\'t find an exact answer to my problem searching SO tonight...

I have a UIButton which contains a UIScrollView

3条回答
  •  情歌与酒
    2020-12-20 02:49

    Create a subclass of scrollview and override

    -(BOOL)touchesShouldBegin:(NSSet *)touches withEvent:(UIEvent *)event inContentView:(UIView *)view
    {
    return YES;
    }
    

    Also subclass the uibutton(Your superview) and handle touches in touches began.

提交回复
热议问题