Customizing UIActionSheet??

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

  1. sujithkrishnan macrumors 6502

    May 9, 2008
    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
      File size:
      17.1 KB
  2. brianchris macrumors newbie

    Sep 15, 2009
    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)

  3. Darkroom Guest


    Dec 15, 2006
    Montréal, Canada
    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.

    [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

    Mar 19, 2009
    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

    Jul 2, 2009
    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