UITableViewController with a UIPickerView sliding up the screen - iphone

I have a UITableView where a cell needs to be filled in with a date by selecting it through a pickerview. Instead of pushing the pickerview onto the navigationController I would want to let it slide up halfway into the screen with the tableview still visible in the upper half of the screen. I've seen some apps doing this neat effect before but I don't see on how to accomplish this.
Anyone some helpful hints on this ?

I did this a little while back and asked about it.
I ended up doing exactly what the highest voted answer says: Put the UIPickerView in the same View as your other items and animate the sliding motion using UIView's beginanimation method.

Add a done button in your tool bar. Add a new target/action to the button to call a method on the UIViewController that has your table view and picker controller. Then have it animate the view back off the screen using a UIView animation block.

Related

iphone uidatepicker in actionsheet with toolbar?

I have looked everywhere and I could not find a 'good' solution to display a uidatepicker when a tableviewcell is tapped. In the following screenshot, the datepicker slides up from the bottom and the background of the view is dimmed. There are done and cancel buttons on the toolbar within the view that holds the datepicker.
appreciate your help
If you're targeting 3.2 or higher, just assign a view containing the picker and whatever buttons you need as the cell's inputView, override the cell's canBecomeFirstResponder method (if necessary) so it can become the first responder, and call becomeFirstResponder on it when tapped.
If you're still targeting earlier versions, you'll have to add that view with the picker and buttons to the hierarchy, animate the sliding, and so on all manually.

Dim out other components when UIPickerView is active

In my little iPhone application, I created UITableView with a UIPickerView which dynamically slides up when a cell is tapped. Since I don't want users to tap other cell when choosing value in the UIPickerView, I hope to make it less distractible by dimming out all the other components (the table, the title bar, etc). Kind of like what isolator does.
I think there might be some api method does this, but I can't find it. Any thoughts are greatly appreciated.
When a cell is tapped you can add another uiview and set its alpha 0.5 and keep uipickerview above it so the background will look dimmed.
If you have call back methods for presenting the picker, then you can disable and enable the user interaction of the root view of the view controller.

Adding a button in the bottom of a TableView

I'm trying to add a button on the bottom of a TableView, without any success.
The idea isn't to use the tableFooterView property, as that doesn't show the button in a fixed position.
My idea is more along the lines of the Facebook application's Notifications bar on the bottom.
I'm using Three20.
Any pointers on how I can achieve this?
Thanks
Just add button to the view below your tableview but ensure your table height is less than the position you are adding the button,this way your can scroll table above button & your button will always be visible
Just embed custom view over your tableview.i mean on the bottom of tableview.so the tableview will scroll and the view don't.
Add a UIView as the footerView and then add the UIButton to the UIView.

iPhone UIActionSheet with UISwitch and UITextField

I'm just looking for advice with this as I have no idea where to start but I think a UIActionSheet is probably best.
What I'd like to have is a pop up window (in my head I picture it as being translucent and dark gray). It will not take up the whole screen and the view underneath will still be visible.
In the pop up section there will be a textfield (with several lines) and underneath this there will be a number of UISwitches.
The pop up will be scrollable and will end with OK/Cancel buttons at the bottom.
Like I said, I really have no idea where to start with this but any advice is more than welcome!
A UIActionSheet is probably not what you are after in this case (although you may want a similar look and feel). Think of an action sheet as a traditional modal OK/cancel/Yes/No type dialog box:
Use the UIActionSheet class to present the user with a set of alternatives for how to proceed with a given task.
From the sound it of it, you need to create a UIView in InterfaceBuilder with a semi-transparent background and various child controls (UISwitches and UITextFields). You create your view using the XIB you have configured and add it as a subview of your UIViewController's view. If you want to mimic the animation you get from an action sheet, you can do that with an AnimationBlock.

How to implement view sliding in and out in iPhone?

I would like to implement the effect of a view sliding in, much like the animation of a view being brought in by presentModalViewController, but the view only slides in to cover half the screen.
I approached it this way:
1) Right before thew view should appear and slide in, addSubview the child view. Position it in such a way it's out of view in the beginning.
2) Call a method on the view controller of the subview to perform the Core Animation code to bring it in.
Doing the above didn't seem to work (nothing happens - the view just appears at its starting location). Adding the view ahead of time in viewDidLoad won't work either. Ideally, I would like the code to have the same requirement as presentModalViewController - which requires you to instantiate the view controller at the point you need to bring the view in and animate it.
Would appreciate if you can provide pointer or code on animating the view in/out as well.
I would check out the sample project ViewTransitions on the Apple dev site. It is a great resource for understanding the simple things you need to do when setting up transitions. If you wanted to only slide in half-way you could try setting the frame of the "sliding view" to only half the screen... just check out the code and give it a try.
I usually animate modal screen in the parent viewController instead of modal viewController itself.
Maybe you should post the code you use in step number 2.
I did something similar on one of my apps, where the user slides a view from one edge of the screen to the other as if placeing a cover over the screen.
If what you are trying to do is an automatic animation (without user interaction) I believe that you need to: set to the sliding view a frame representing the final position. Do this within an animation block. Play with the duration, animation curve, etc parameters.