views:

28

answers:

1

I have a UIActionSheet and would like to adjust (increase) its width to accommodate the text of the buttons that it contains. The width of these buttons is determined at runtime and could change during runtime.

I have mucked around with [[actionSheet superview] superview] to get the containing UIPopoverView, but changing its frame doesn't yield desired results. And, mostly, this just seems an extremely fragile way to go.

I tried [actionSheet sizeToFit] without any noticeable effect.

So, I am hoping that I have overlooked some obvious method for adjusting the size of the UIActionSheet/UIPopoverView.

Thanks.

+1  A: 

It doesn't work, as you have probably figured out. The common solution is to create a custom UIViewController and display it using UIViewController's presentModalViewController, which can give you a nice slide up transition, much like how a UIActionSheet appears.

But that solution is missing something. A UIActionSheet slides up, but not all the way, leaving a semi-transparent covering over the parent view. There is a brilliant detailed tutorial with code and project which will try to show you how to display a custom view with this same effect.

http://www.nearinfinity.com/blogs/andrew_homeyer/display_a_custom_uiview_like_a.html I wish i made this tutorial before this guy made it! he got there before me

PK

Pavan
In the interest of time, I have modified the text in the buttons. Once we start localizing that text to other languages, we will need to revisit this. Apparently, "Email data CSV" will become "Courrier électronique de données CSV" in French and "Correo electrónico de datos CSV" in Spanish. Thanks for pointer.
westsider