Replicating UIAlert style in UIView?

Discussion in 'iOS Programming' started by mraheel, Jun 6, 2009.

  1. mraheel macrumors regular

    Joined:
    Apr 18, 2009
    #1
    Well, i was playing around with UIAlertView and thought How wonderful would it be if i could replicate a view to appear just as so- transparent/ shorter window.
    I may be violating the interface guidlines? i wouldnt know.. ?

    I basically wanted to use modalView, but i needed something more than UIButtons, If i could add a few more controls, my purpose is served. Is this possible? so I was looking for alternatives of making a kool UIView to kinda replicate the modal or alertview? is it possible?

    I wish to do so, because i need just a tid bit more than a UIButton, the purpose itself is identical to use of modalview

    Any directions would be much appreciated!

    Another ahem, kinda easy question is how do i delete a character at position off of NSString.
    ",22,33,44,55" needs to be "22,33,44,55"
    I can think of lstrcmp, strpos in Cpp, but im struggling to find something in documentation
     
  2. johnnyjibbs macrumors 68030

    johnnyjibbs

    Joined:
    Sep 18, 2003
    Location:
    London, UK
    #2
    I think you are perfectly valid to subclass UIAlertView to create your own custom class. An alertview is just a special kind of view so you should be able to change its own private self.view to whatever view or graphic you want and it should appear in alert view fashion upon the command

    Code:
    [myCustomAlertView show];
    I saw a post on here somewhere where someone had done that to great effect to create a 'game over' screen.

    I think you just add whatever buttons etc you want as subviews of the main view to get the desired look.
     
  3. mraheel thread starter macrumors regular

    Joined:
    Apr 18, 2009
    #3
    Subclassing UIAlertView would completely change the characteristics of that alertview to a simple view? meaning things like only UIButtons, only a single touch dismisses the view.. things like that. if its true, tats all I need..
    I'd search for that discussion you;ve mentioned.
    thanks man.
     

Share This Page