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

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -