ios - iPhone: Click view behind transparent UIScrollView -
i have uiscrollview set have clear background. part of scrollview have content, part not (so shows other views behind it). able click through uiscrollview , mkmapview behind, transparent portion of uiscrollview.
i have found code having real hard time understanding how working:
- (void)touchesbegan:(nsset *)touches withevent:(uievent *)event { if (![self yourmethodthatdeterminesinterestingtouches:touches withevent:event]) [self.nextresponder touchesbegan:touches withevent:event]; }
could me wrap mind around how forward touch event view behind view? can call - (void)touchesbegan:(nsset *)touches withevent:(uievent *)event uiviewcontroller?
what did subclass uiscrollview , implement logic passes responsibility down views under it, if touch happens inside of transparent area.
in our case transparent area defined contentoffset of 120 on y axis, meaning our content starts 120 points below start of uiscrollview, , code looks this:
- (bool)pointinside:(cgpoint)point withevent:(uievent *)event { if (self.contentoffset.y < 0 && point.y < 0.0) { return no; } else { return yes; } }
obviously response past prime helpful searching solution.
Comments
Post a Comment