I have an image with irregular shape. I set it as a background image of an UIButton.
Now, I use OBShapedButton library to enable touch only where image is non-transparent.
But, for some reason if I click on transparent image area, when view appears in screen, then it responds to click, whereas it should not.
I made some area of image transparent using adobe cs4 photoshop. Now, I want to try making it transparent in xcode only. May be it helps.
To have an idea of image shape I am attaching a sample image.
Does anyone know how to do that?
Asked
Active
Viewed 467 times
0
-
look like you haven't solved this issue, refering to your other [question](http://stackoverflow.com/questions/16419151/how-to-create-curved-uibutton-for-iphone-application). can you send me a sample image you are using. – Bonnie May 14 '13 at 07:39
-
@Bonnie Yeah, it is not solved yet. The image I use for testing is attached in the question. – Geek May 14 '13 at 08:00
-
I used, the same image you gave, replaced it with the sample image in the, OBShapedButton demo. and its working perfectly. there's something defiantly wrong with the way you are using it. and also please accept the answer for your previous questions. – Bonnie May 14 '13 at 08:24
-
@Bonnie But I have created a new fresh project which does not have any code other than IBAction (which I put to NSLog when button is clicked). In storyboard I just have a UIButton with this image. Then what can be the wrong? I found the same problem in custom shaped demo of OBShapedButton library. – Geek May 14 '13 at 09:19
-
ya when i check, with the Complex demo, and used ur image, it had a false trigger, as u said. but when i decrease the size of the button, it worked again, make sure the Image size and your button size are almost same size. – Bonnie May 14 '13 at 09:24
-
@Bonnie Tried decreasing button size. The problem is still there. It just decreases the area prone to false trigger. – Geek May 14 '13 at 09:50
-
let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/29910/discussion-between-bonnie-and-akash-patel) – Bonnie May 14 '13 at 09:51