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).
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- back button text does not change
相关文章
- 现在使用swift开发ios应用好还是swift?
- Could I create “Call” button in HTML 5 IPhone appl
- TCC __TCCAccessRequest_block_invoke
- xcode 4 garbage collection removed?
- Unable to process app at this time due to a genera
- How can I add media attachments to my push notific
- How do you detect key up / key down events from a
- “Storyboard.storyboard” could not be opened
Use .cancel UIAlertActionStyle as an option.
Use showFromRect, for example:
This does not answer the question exactly, but here is what I do to close the picker when clicking on one of its items (this prevents from adding additional "done" button or "outside click" stuff):
Implement the
viewForRow
picker's delegate method in which you create a UILabel and return it:On those custom row labels, add a tap action handler:
In the
handleClick
callback, dismiss the open sheet (the one that contains the picker view):Ok got a solution. The following applies to a subclass of a UIActionSheet
The gist of it is to add a gesture recogniser to the action sheet's superview, and test all taps to see if they are above the action sheet.