How to manually program custom buttons?

Discussion in 'iOS Programming' started by kexu, Nov 10, 2011.

  1. kexu macrumors newbie

    Joined:
    Oct 14, 2011
    #1
    I want to make a custom button (a button other than UIButton). For example, in games, their menus are generally composed of unique buttons that are not the white-with-a-blue-outline style of UIButton.

    How can I make these? Are they images or something?

    I want them to trigger methods that create new views.
     
  2. jnoxx macrumors 65816

    jnoxx

    Joined:
    Dec 29, 2010
    Location:
    Aartselaar // Antwerp // Belgium
    #2
    ... if u take a standard UIButton, set his style to Custom, it has no borderline, and is clear, then you can assign images. So don't really need to make your own buttons.. Have you checked any iOS development tutorials?
     
  3. PhoneyDeveloper macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #3
    Buttons can have a title or an image. They can also have a background image and a background color. So you can have text over the background image. These properties can be set for different states of the buttons so they change when the user taps the button.
     
  4. kexu thread starter macrumors newbie

    Joined:
    Oct 14, 2011
    #4
    Oh ok so I can actually edit the UIButton's properties properties to look like an image? Thanks...the book I'm reading hasn't covered that.
     
  5. firewood macrumors 604

    Joined:
    Jul 29, 2003
    Location:
    Silicon Valley
    #5
    The most custom way is to just draw whatever you want in the larger view, and then check the XY location of any touch event in the view for hits in your custom location rects. Handle, animate, and/or redraw as desired.
     
  6. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #6
    Which book is that? (Title, author, edition)
     
  7. kexu thread starter macrumors newbie

    Joined:
    Oct 14, 2011
    #7
    iOS Programming: The Big Nerd Ranch Guide: 2nd Edition.

    They might cover it, but if they do I haven't reached it yet. I skimmed through and it doesn't appear to.

    Sorry...I sort of just started with programming and it's getting really confusing.
     
  8. firewood macrumors 604

    Joined:
    Jul 29, 2003
    Location:
    Silicon Valley
    #8
    The "book" you want to read is Apple's Cocoa Touch reference documentation for any class you might want to customize or use.
     

Share This Page