Question about UIButtons

Discussion in 'iOS Programming' started by Eddy27, Mar 27, 2015.

  1. Eddy27 macrumors newbie

    Joined:
    Feb 15, 2015
    #1
    I'm still learning objective-C and saw a really nice button push effect in the app Clash of Clans that I would like to emulate. Basically I want to learn how to make the button smaller and have a lighter color or glow when pushed, giving it a nice visual "pushed in" effect as shown in the attachment images. One is the normal state, the other the pushed in. I want to be able to do that programmatically if possible. How would I go about doing so?

    Thanks!
     

    Attached Files:

  2. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #2
    UIButtons have a property called state. You can specify different images (or background images) for different states. Just assign a different image for the selected state.

    More here: UIKit User Interface Catalog: Buttons
     

Share This Page