Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

tonydleopard

macrumors newbie
Original poster
Nov 21, 2008
6
0
Hi,

I am a newbie to sdk. I am creating an app which has a custom navigation bar being put inside a scrollView. The navigation bar is generated by overriding the drawRect method of UIView class. The navigation bar has other items which are not part of the scroll view. Now the problem is the items inside the navigation bar which falls inside the scroll view is not responding to any of the touch events. The hierarchy of the app is as follows the mainView--> Navigation Strip(Which is a subclass of UIView)-->ScrollView inside the Navigation Strip.

Thanks in advance,
Tony
 

tonydleopard

macrumors newbie
Original poster
Nov 21, 2008
6
0
yeah the issue is solved.

The solution is to subclass the UiScrollView and create the scrollview from this subclass. then implement the touchesBegan, touchesEnded methods inside the subclass and it will recognize the touches for you. Implementing the touchesmoved method may screw up you scroll view as scrolling maynot happen.

Thanks,
Tony
 

fenrus110

macrumors regular
Mar 24, 2008
142
0
i had no problems implementing touchesBegan on my UIScrollView. maybe because I had stuff on top of it acting like a cover over top of it.

If you want to implement touchesMoved, you should set scrollEnabled = NO; on touchesBegan, then re-enable it on touchesEnd.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.