iphone - check if UIView is in UIScrollView visible state -
what easiest , elegant way check if uiview visible on current uiscrollview's contentview? there 2 ways this, 1 involving contentoffset.y position of uiscrollview , other way convert rect area?
if you're trying work out if view has been scrolled on screen, try this:
cgrect theposition = myview.frame; cgrect container = cgrectmake(scrollview.contentoffset.x, scrollview.contentoffset.y, scrollview.frame.size.width, scrollview.frame.size.height); if(cgrectintersectsrect(theposition, container)) { // view has been scrolled on screen }
Comments
Post a Comment