开发者

How does one create a UIActionSheet with a label and a value pair in the button titles

开发者 https://www.devze.com 2023-03-10 06:30 出处:网络
How does one create a UIActionSheet or inherit from it to show label-value pairs in the button titles, as can be seen in the iOs\' phone book->detail view for a contact->send text message.

How does one create a UIActionSheet or inherit from it to show label-value pairs in the button titles, as can be seen in the iOs' phone book->detail view for a contact->send text message.

For example such a UIActionSheet开发者_运维百科 might look like this:

mobile  1(23)555321

iPhone  1(23)555123

  home  1(23)555456

      cancel

Each button has a "label" (appears in gray) and a "value" (black). So, is this feature implemented in the UIActionSheet already? Or should i customize or inherit to add this feature, or should i write a complete new thingie?


The best way for your needs will be to implement the whole thing by yourself. It's not supposed to be that complicated. This if you really want it like UIAlertSheet show up from wherever (bottom, top, center). Take into consideration, that on iPad it will look different. You can use UIAlertView, which is much more simpler to customize. You can add your custom views there and it will look same on iphone/ipad.


This feature is not a public part of UIActionSheet. You will need to write your own, and I doubt you'll be able to simply subclass UIActionSheet, because its behavior changes dramatically when the number of items exceeds the available screen space, or when running on an iPad instead of an iPhone or iPod touch.

0

精彩评论

暂无评论...
验证码 换一张
取 消