UIActionSheet is not showing separator on the last item on iOS 7 GM

后端 未结 8 446
暗喜
暗喜 2020-12-03 04:31

It could be probably a bug on iOS7. But the last button is not separated from the previous one\"UIActionSheet

相关标签:
8条回答
  • 2020-12-03 05:07

    I found a way to make it work on iPhone and iPad in the least hacky way:

    1. Only init the UIActionSheet with a title
    2. Add your buttons
    3. Add a "CANCEL" button at last
    4. set the CancelButtonIndex to that last index

    I assume that the missing separator is caused by the cancel button not being recognized as a separate case when adding it first or through the init.

    0 讨论(0)
  • 2020-12-03 05:09

    I think ActionSheet requires a cancel button.So you can add the cancel button title.

    Another way is: Specify actionSheet's cancelButtonIndex.

    For example,in your case, you can add a "Cancel" in otherButtonTitles at index 4 and then specifiy actionSheet.cancelButtonIndex = 4.

    0 讨论(0)
提交回复
热议问题