Custom UIAlertView?

Discussion in 'iOS Development' started by hitman2992, Feb 20, 2009.

  1. hitman2992

    hitman2992 New Member

    Joined:
    Dec 10, 2007
    Messages:
    123
    Likes Received:
    0
    Device:
    iPhone 3GS (Black)
    I would like to create a custom UIAlertView. I am not looking to add things into the UIAlertView I am looking to redesign it for example:

    instead of this

    Please Register or Log in to view images



    I would like to be able to create something like this

    Please Register or Log in to view images



    is this possible?
  2. SkylarEC

    SkylarEC Super Moderator Emeritus Staff Member

    Joined:
    Sep 19, 2007
    Messages:
    6,642
    Likes Received:
    129
    Yes it's possible. Either go through its subviews and change what you need to change, or subclass it.
  3. hitman2992

    hitman2992 New Member

    Joined:
    Dec 10, 2007
    Messages:
    123
    Likes Received:
    0
    Device:
    iPhone 3GS (Black)
    thank you

    is it possible to have some sample code?
  4. jbwk

    jbwk New Member

    Joined:
    Apr 3, 2009
    Messages:
    1
    Likes Received:
    0
    customization sample code

    I've posted a small article on the subject of subclassing UIAlertView for customization on

    http://joris.kluivers.nl/iphone-dev/?p=CustomAlert

    While my example does not use the default title, text and buttons it shouldn't be to hard to override initWithTitle: initializer to set your own views.

    Just make sure you set self.bounds in the show method to fit your layout and background image.

Share This Page