iOS 3.2 (iPad)

I want to present a UIActionSheet on an iPad. The label strings for the choices 
are dynamically constructed. The strings may be wider than the buttons, and 
tail truncation isn't good — the distinct parts are mostly at the end.

Is there any way to get middle truncation into the labels in a UIActionSheet? 
The obvious way is to truncate the strings myself before putting them into the 
sheet, but it looks as though I'd have to do that myself, and I won't get it 
right for the display width. The string-drawing category of NSString will let 
you _measure_ or _draw_ a truncated string, but you can't get the truncated 
string back. I suppose one could iterate trial truncations until I find one 
that fits, but it seems inelegant.

A nice way to do it would be to set some sort of property in the sheet or its 
buttons, in the willPresentActionSheet: delegate method if necessary. There 
seems to be no hook for that, other than iterating the sheet's subviews for 
UIButtons and setting the truncationMode of the respective labels. This doesn't 
sound like a winning bet for future compatibility.

Ideas, please?

        — F

_______________________________________________

Cocoa-dev mailing list ([email protected])

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to