Customizing UIActionSheet??

Discussion in 'iOS Programming' started by sujithkrishnan, Feb 11, 2009.

  1. sujithkrishnan macrumors 6502

    Joined:
    May 9, 2008
    Location:
    Bangalore
    #1
    Hi all,

    I just want to know how to get a layer/view like what i attached??

    How to position Buttons like that (see attached image) ??

    Is it customising actionsheet???

    About ActionSheet customization
    1. I tried overriding drawRect of actionsheet... and am able to give custom color for that.. But how to give custom shape????

    2. Is it possible to override the button positions in actionSheet?

    3. which all properties for a actionSheet can implement by extending/implementing category?
     

    Attached Files:

    • a.png
      a.png
      File size:
      17.1 KB
      Views:
      6,405
  2. brianchris macrumors newbie

    Joined:
    Sep 15, 2009
    #2
    Have u got done with custom actionsheet

    I too want the same type of custom action sheet with buttons placed horizontally as you shown... I was trying for it very long...Have you got done with this custom actionsheet.
    Please help me with your comments and codes(if any)

    Thanks,
    Brian
     
  3. Darkroom Guest

    Darkroom

    Joined:
    Dec 15, 2006
    Location:
    Montréal, Canada
    #3
    you can set the number of button rows for an action sheet or alert view, but xcode will issue a warning since it's an undocumented a part of the SDK. the following still worked with SDK 3.0, not sure about 3.1.

    Code:
    [myAlert setNumberOfRows:1];
    
    apple may remove this functionality in future updates, so consider rolling your own alert view class, which you could also further customize, instead of using apple's.
     
  4. erniethomason macrumors newbie

    Joined:
    Mar 19, 2009
    #4
    Here's what you can do: Create an action sheet without any buttons by setting the 3 button title settings to nil. For the title, set it something like @"\n\n\n" which will give you some extra space by using line-feeds as the title. Finally, add your custom views (buttons, whatever) with something like [actionSheet addSubview: myButton];
     
  5. Troglodyte macrumors member

    Joined:
    Jul 2, 2009
    #5
    Don't use undocumented SDK methods or classes. Apple has been checking for this sort of thing and can reject apps for it.
     

Share This Page