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 06-17-2010, 11:26 PM   #1 (permalink)
Registered Member
 
Join Date: Jun 2010
Location: Puerto Rico
Posts: 4
elcool is on a distinguished road
Default Disabling touch on transparent UIView

I have UIImageViews and UIViews (with image), and both have transparent backgrounds that surround the image.

What I want to do, is to identify when a touch is done on the transparent part of the image, so that it doesn't do anything (no events occur).
Right now, anywhere you touch inside the view's rectangle will work as a UITouch, but I just want the user to have to touch on the real image not just touch near the image.

How do I go about disabling touch on the transparent part?

I have little code since I've been searching if this is a checkmark or if I have to code and identify the pixels.
elcool is offline   Reply With Quote
Old 06-18-2010, 03:53 PM   #2 (permalink)
Registered Member
 
Join Date: May 2010
Posts: 107
JDave is on a distinguished road
Default

There are a few ways to do this... none are very easy.

You need to identify if the point you touch is transparent.

Then you need to ignore/discard the transparent touches or pass them to the next layer.

Easier said than done, right? Check out Jeff LeMarche's blog for more details:
iPhone Development: Irregularly Shaped UIButtons
JDave is offline   Reply With Quote
Old 06-18-2010, 11:41 PM   #3 (permalink)
Registered Member
 
Join Date: Jun 2010
Location: Puerto Rico
Posts: 4
elcool is on a distinguished road
Default

Yeah, my thoughts were in the right direction, just didn't know how.

Thanks for pointing out that article. That's just what I need.
elcool is offline   Reply With Quote
Reply

Bookmarks

Tags
transparent, transparent background, uiimageview, uitouch

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: 333
9 members and 324 guests
Absentia, Chickenrig, Domele, fiftysixty, givensur, heshiming, michaelhansen, PixelInteractive, Sloshmonster
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,657
Threads: 94,118
Posts: 402,892
Top Poster: BrianSlick (7,990)
Welcome to our newest member, jenniead38
Powered by vBadvanced CMPS v3.1.0

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