Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Tutorials

Reply
 
LinkBack Thread Tools Display Modes
Old 09-28-2009, 12:41 AM   #26 (permalink)
Registered Member
 
Join Date: Jul 2009
Posts: 9
Default

no difference. I have a NSLog statement at touchesShouldCancelInContentView, but that NSLog never gets printed suggesting that the method isn't getting accessed. Can you elaborate more on the handling of touches not within ScrollView but within content?
anuragphadke is offline   Reply With Quote
Old 06-24-2010, 05:02 PM   #27 (permalink)
Registered Member
 
Join Date: Apr 2010
Posts: 1
Thumbs up

Quote:
Originally Posted by slahteine View Post
What result do you get if you return NO from touchesShouldCancelInContentView?

Also, you shouldn't be handling any touches in the ScrollView itself, only in the content views within it.
@slahteine

Man, you rule! They should call you a Programming Wizard. oh wait...

Seriously, thanks for those tips! I now have UIScrollView that scrolls like it should and can be swiped away (or whatever response you like) with a single swipe.

Dennis
dennisolly is offline   Reply With Quote
Old 07-17-2010, 03:38 PM   #28 (permalink)
kum
Registered Member
 
Join Date: Jul 2010
Posts: 1
Default

Great tutorial. However I still have some issues.

I enabled paging so that I could scroll through different views. The problem is that only the first view is able to detect touches and the others can't. Why is this?

Last edited by kum; 07-17-2010 at 06:26 PM.
kum is offline   Reply With Quote
Old 09-29-2010, 09:46 AM   #29 (permalink)
Registered Member
 
Join Date: Sep 2010
Posts: 1
Default

Quote:
Originally Posted by kum View Post
Great tutorial. However I still have some issues.

I enabled paging so that I could scroll through different views. The problem is that only the first view is able to detect touches and the others can't. Why is this?
This might be the case, when you have not set the size of the scroll view's content view correctly. So if you have a scrollView and a contentView as it's child (containing your different views), you should be doing something along the lines:

Code:
CGRect contentFrame = contentView.frame;
contentFrame.size.width = newWidth; // set new width here
contentFrame.size.height = newHeight; // set new height here
contentView.frame = contentFrame;

scrollView.contentSize = contentView.frame.size;
michael.liebwein is offline   Reply With Quote
Old 03-11-2011, 10:10 AM   #30 (permalink)
Registered Member
 
Join Date: Oct 2010
Posts: 41
Exclamation

Great Tutorial! Really helpful.

I have one question though, How do I check WHERE it is touched? I have this code in my "myImageView"

Code:
-(void) touchesBegan: (NSSet *) touches withEvent: (UIEvent *) event
{	
	UITouch *touch = [touches anyObject];
	CGPoint touchPoint = [touch locationInView:self];
	NSLog(@"Touch detected at: X = %d, Y = %d", touchPoint.x, touchPoint.y);
}
But that returns this in the log:

Code:
2011-03-11 07:05:56.969 Us![3428:207] Touch detected at: X = 0, Y = 1085492480
2011-03-11 07:05:57.322 Us![3428:207] Touch detected at: X = 0, Y = 1085492480
2011-03-11 07:05:57.529 Us![3428:207] Touch detected at: X = 0, Y = 1085492480
And that is DEFINITELY not where I touched it, and I moved quite a lot to try and get something else. Thanks!

EDIT: Nevermind... I was logging it incorrectly. :P

Last edited by cvcs1; 03-11-2011 at 10:26 AM. Reason: Stupidity
cvcs1 is offline   Reply With Quote
Old 03-13-2011, 05:03 PM   #31 (permalink)
Registered Member
 
Join Date: Mar 2011
Posts: 1
Default

Cool posts indeed.
Please carry on guys with more cool tutorials.
__________________
earplugs
Smith01 is offline   Reply With Quote
Old 03-24-2011, 03:49 AM   #32 (permalink)
Registered Member
 
Join Date: Mar 2011
Location: India
Posts: 1
Default Reply

A very good work done by you.
__________________
Thanks and Regards
Delhi Packers and Movers
Jasika8745 is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Stats
Members: 158,884
Threads: 89,229
Posts: 380,763
Top Poster: BrianSlick (7,129)
Welcome to our newest member, karlam963
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 02:17 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0