Question about UIButtons

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

  1. Eddy27 macrumors newbie

    Feb 15, 2015
    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?


    Attached Files:

  2. dejo Moderator


    Staff Member

    Sep 2, 2004
    The Centennial State
    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