touchscreen - iPad: touchesBegan not being called when dragging finger from upper screen border -


i writing ipad application can drag around screen 1 or 2 fingers. use touchesbegan, touchesmoved , touchesended methods recognize touches. have multipletouches enabled view.

now have recognized 1 strange behaviour. if place finger outside of upper screen border , drag down screen won't receive call touchesbegan or touchesmoved. can not reproduced other screen borders.

the other case can reproduced when use landscape orientation home button left side. in case same behaviour upper screen border.

has information or experience same if testing?

edit: did additional testing. area statusbar receiving touchesbegan or touchesmoved fine if put down finger in region or slide upwards lower screen position. input not recognized if slide finger down position completly above screen edge.

edit2: additional info: - app uses opengl view. - statusbar hidden. - touchesbegan called when touching (hidden) statusbar areas in orientations.

i believe underlying issue touch-sensitive layer on screen extends few pixels above visible screen, meaning touches originating there technically start outside uiviewcontroller view. since uiviewcontroller sees touches originate within view, won't see these touches. if device screen touched pixel or 2 above visible pixels, touch sent whatever virtual layer exists in offscreen area (perhaps status bar?). prevents uiviewcontroller receiving touches, since swipe did not originate in uiviewcontroller's view area.

to work around this, @ applicationdidlaunch time can resize uiwindow (say) 10 pixels larger on each side, , create intermediate uiviewcontroller 'background' layer inside it, matching expanded size of window. set main interface uiviewcontroller view child of 'background' view, inset 10 pixels on sides re-match physical screen size. if interface rotates, 10-pixel enlargement of background view have re-applied in willanimaterotationtointerfaceorientation method in background uiviewcontroller each time.

finally, have touchesbegan/moved/ended methods in background view controller forward touches directly corresponding methods in main ui view controller. voila!

hope helps, ben


Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

aspxgridview - Devexpress grid - header filter does not work if column is initially hidden -

c# - How to execute a particular part of code asynchronously in a class -