|Jan 28, 2011, 03:43 PM||#1|
How to go about images on top of buttons?
I'm trying to understand how to go about doing this.
I have an app, on launch it draws a button 300x300 with and image of a big button.
If you press the big button it fades out and get replaced by another button (just a different colour)
So far so good, I have been able to create buttons with images on there that animate the switch nicely.
So far I have only been using IB to add these buttons to one single view, bit of a side question but how can I guarantee the order of the images (I.E. Button 1 is always the visible one at start).
Right, back to my actual question. On top of this second button I want another image, much smaller with transparent background, that will move around on top of the button.
- will my button still be clickable?
- how would I go about doing this? Can I just stack images on top of eachother or do I need to stack views etc?
I have been trying to google a tutorial that will explain these bits so if you'd happen to know one...
|Jan 28, 2011, 08:42 PM||#2|
Ok... I'm not too experienced yet, but here's a shot:
UIButton is a UIView, which has a hidden property. You can check this in IB for your 2nd button, and then set it for button 1 and turn off for button 2 when you want to switch between them. This guarantees that button 2 is invisible at start.
About the floating image, I actually don't know how you would do this. My hack would be to have a floating imageview but not on the button itself but just somewhere on the window. It would normally be invisible. When you swap your button, you also set this floating imageview to visible. Since your big button is not gonna be moving, you'll know its coordinates, so you can constrain the coordinates of the imageview to stay within the bounds of the big button.
Hope that made sense or was mildly helpful.
|Thread Tools||Search this Thread|
|thread||Thread Starter||Forum||Replies||Last Post|
|Safari Top Sites preview images not updating||stocklen||OS X Mavericks (10.9)||10||Dec 18, 2013 08:38 AM|
|Replicate Xcode's Show/Hide buttons from Top Right Corner?||ArtOfWarfare||Mac Programming||0||Nov 16, 2013 10:24 PM|
|What app allows squiggles/sketching on top of images taken on your phone?||overground||iPhone||1||May 22, 2013 12:43 AM|
|Supporting iPhone 3GS/Non-Retina Images & Buttons For iPhone||loon3y||iPhone/iPad Programming||5||Feb 15, 2013 04:30 PM|
|Creating Images for Buttons||BadWolf13||Mac Programming||5||Jun 2, 2012 12:59 AM|
All times are GMT -5. The time now is 09:42 AM.