I have a UIPickerView on a UIActionSheet. Right now the UIActionSheet makes the view behind the UIActionSheet not touchable. Is there a way that I can make it touchable? Or is that just how a UIActionSheet works?
I don't believe it is possible to make the view behind the UIActionSheet touchable without dismissing it first. They're meant to be modal, i.e. require the user's attention before being dismissed.
From UIActionSheet class reference (emphasis mine):
For applications running on iPhone and iPod touch devices, the action sheet typically slides up from the bottom of the window that owns the view. For applications running on iPad devices, the action sheet is typically displayed in a popover that is anchored to the starting view in an appropriate way. Taps outside of the popover automatically dismiss the action sheet, as do taps within any custom buttons. You can also dismiss it programmatically.
I suppose a way around this could be that you just create your own view that displays similarly. For example, create a UIView that you can animate the same (slide up) when a button is pressed. This UIView can contain your UIPickerView and whatever else you need (probably a cancel button to dismiss it).
Hope this helps, good luck!
Related
As below screenshot showed, I have a black dimmer View on the top and a viewController on the bottom(the white one) with half screen size.
What I want to do is when I tap on the dimmer place aka. outside of the viewController. This viewController should be dismissed.
YES, I found tons of topic using touchesBegan. But in my case it is not working, the problem is touchesBegan cannot detect touches outside current presented viewController. It would never be triggered when I click on that dimmer view.
And if I use Gesture check on the dimmer view, I could not dismiss this viewController from dimmer view too.
Any advice is welcomed if anyone met this similar situation with me.
You should be able to add a UITapGesture to the views window, look here: Dismiss modal view form sheet controller on outside tap
I am creating a reader app and have the kindle app as an
inspiration.
From the reader view (uiscrollview) I wish to present/animate a navigation bar
and toolbar on a tap. Now the app (uiwindow) already has as its root view controller
a navigationVC, which is used for the flow for selecting book category and a book. I then make the top bar invisible when displaying the actual text in my uiscrollview.
I want to display that navigationVC again on a tap, is that possible? I tried in my uiscrollview bind a tapgesturerecognizer to present that controller modally but it didn't work.
Thanks!
It works now, it wasn't as advanced as I thought. Actually, I had an error in my gesturerecognizer handler, which didn't set the UINavigationController's properties :).
I want to rise a UIActionSheet with one normal "Cancel" button as usual, but with a few non-dismissing buttons, as all buttons on action sheet dismiss the sheet when touched down.
I've tried to add UIButtons using addSubView but Im having a tough time dealing with the ActionSheet size.
Any advice?
TY!
I don't believe you can do this with a UIActionSheet.
You could however create your own view that looks like an ActionSheet and add it to the View in question. Add some core animation to make it slide up and down and viola! You'd have a custom UIActionSheet!
I'm now working with view-based application. It's just simple. If I touch the view, the view flips using animation ability of UIView. This is all.
What I want to do after this...is...locating a kind of button in the middle of the main view. BUT!, the button must not be animated while the main view is flipping.
How do I do this?
I dont know this is a correct way or not and i havnt tried this. Just a thought.
Create a UIButton in appdelegate and add that button as subview to the UIWindow.
So you can access that button in anyview and so that you can keep that button in the front and change view controllers.
ive been looking at some tutorials on a toolbar they all are implemented through the navigation controller delegate. Is there a way i could use the toolbar without using the navigation controller?
right now i have a ViewController with a Scrollview in that scrollview i have images when the user uses a touch gesture then i want a toolbar to be viewable and usable to the user just like on the Photo App.
i want to know how i could use the toolbar and make it functional without going through the app delegate and staying on the current viewController.
A toolbar can be created and positioned just like any other view. Don't confuse toolbars with tabbars.