Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Jan 28, 2011, 03:43 PM   #1
dantastic
macrumors 6502
 
Join Date: Jan 2011
How to go about images on top of buttons?

Hi again,

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...

thanks!
dantastic is offline   0 Reply With Quote
Old Jan 28, 2011, 08:42 PM   #2
MaxFreud
macrumors newbie
 
Join Date: Jan 2011
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.
MaxFreud is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

Forum Jump

Similar Threads
thread Thread Starter Forum Replies Last Post
How do i put one image on top of another? LondonGooner Design and Graphics 5 Dec 8, 2009 02:01 AM
Dragging an image on top of an image from the camera... pyroblue iPhone/iPad Programming 0 May 31, 2009 10:55 PM
aah, I have a popup window ad - how to go about getting rid of this tkjazzer Mac Basics and Help 1 Dec 6, 2008 02:03 PM
How to install parallel desktop on top of bootcamp? hidehide Windows, Linux & Others on the Mac 2 May 5, 2007 02:09 PM
How to install OS9 Classic on top of 10.2.8 agdickinson Mac Applications and Mac App Store 4 Oct 29, 2003 02:48 PM


All times are GMT -5. The time now is 12:43 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC