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

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

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

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

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

Reply
 
LinkBack Thread Tools Display Modes
Old 09-09-2011, 02:39 AM   #1 (permalink)
Registered Member
 
Join Date: Jul 2010
Location: UK, North East
Posts: 227
zardon is on a distinguished road
Default Clicking buttons inside a UIScrollView

I recently created a UIScrollView and put some buttons inside it but noticed that the clicks of the buttons (which should just display an alert) do not respond to touches.

I believe this is caused because UIScrollView swallows all touches.

I am wondering if there is a way to register touches of buttons (or any object that allows touches) within a UIScrollView?

I did some searching and found code similar to this:

Code:
// There are other variations out there on the web
- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event {
	if ([self pointInside:point withEvent:event]) {
		return _scrollView;
	}
	return nil;
}

However, I am still unable to get the actual buttons to respond to a click, and I'm hoping someone can point me in the right direction.

Thanks.
__________________
UK-based Junior iOS developer looking for a job, or freelance projects.
zardon is offline   Reply With Quote
Old 09-09-2011, 05:04 AM   #2 (permalink)
Registered Member
 
macoholic's Avatar
 
Join Date: Dec 2008
Location: around a Mac...in Pune,India :)
Posts: 137
macoholic is on a distinguished road
Default

Just a thought....have you tried disabling the userInteractionEnabled propertu of the scroll view ??

Might help!!

Macoholic!!
macoholic is offline   Reply With Quote
Old 09-10-2011, 08:17 AM   #3 (permalink)
Registered Member
 
Join Date: Jul 2010
Location: UK, North East
Posts: 227
zardon is on a distinguished road
Default

Quote:
Originally Posted by macoholic View Post
Just a thought....have you tried disabling the userInteractionEnabled propertu of the scroll view ??

Might help!!

Macoholic!!
I've not tried that, but I'll give it a go. I'll check on StackOverflow just in case its already been solved too. Thanks.
__________________
UK-based Junior iOS developer looking for a job, or freelance projects.
zardon 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 Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 405
9 members and 396 guests
apatsufas, Eclectic, JackReidy, jeroenkeij, Sami Gh, tim0504, UMAD, yomo710, yuncarl28
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,672
Threads: 94,121
Posts: 402,904
Top Poster: BrianSlick (7,990)
Welcome to our newest member, yuncarl28
Powered by vBadvanced CMPS v3.1.0

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