PDA

View Full Version : Customizing UIActionSheet??




sujithkrishnan
Feb 12, 2009, 12:37 AM
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?



brianchris
Sep 19, 2009, 04:19 AM
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

Darkroom
Sep 19, 2009, 09:10 AM
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.

erniethomason
Feb 7, 2010, 06:32 PM
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];

Troglodyte
Feb 8, 2010, 02:17 AM
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.

Don't use undocumented SDK methods or classes. Apple has been checking for this sort of thing and can reject apps for it.