How to make a uiactionsheet dismiss when you tap outside eg above it?

后端 未结 10 1170
清酒与你
清酒与你 2020-12-16 00:48

How do i make a uiactionsheet dismiss when you tap outside eg above it? This is for iPhone. Apparently the ipad does this by default (I may be wrong).

10条回答
  •  眼角桃花
    2020-12-16 01:02

    After setting the cancelButtonIndex property of UIActionSheet with a valid value, tapping outside will dismiss the UIActionSheet. I have tried in iOS 9. However, if this cancelButtonIndex is not set of set to a wrong value (e.g. an index beyond the total button count in the UIActionSheet), nothing will happen when tapping outside.

提交回复
热议问题