Is it possible to make uipicker react only on swipe not on click? - iphone

I made UIPicker and with background on it:
(left is normal size of Picker, on the right is mine)
The problem is: when the user clicks on TextField - the picker reacts and scrolls down. Is it possible to prevent clicking, and make it to react only on swipe?

Add an another UIView above all view then add your UITextField on this UIView.
This will prevent the user interaction conflict.

I think you should move your UITextField farther away from the UIPickerView. Maybe a few notches up as the users touch would cover both the views.

Related

iPhone4 how to add/animate a UIView to appear under a UIButton?

I have a "side panel" like widget in my app that can be swiped in from the side of the screen. In order to help the users find the panel, I also added a UIButton to do the same thing - scroll the panel on and off screen.
The view comes from a different view controller, otherwise I would've simply created an extra panel in the interface builder and positioned it properly.
My problem is that the side panel gets positioned over the button, so if it is displayed with a button, it can only be dismissed with a gesture.
is it possible to specify at which "depth" I add a UIView when I programmatically add it in code?
This is the snipped that slides the panel in or out within the animation block.
self.audioSystemController.view.frame =CGRectMake(0,20, 120,460);
I need the UIView to be shown below a UIButton, so the button may be used to dismiss the view. I know this is redundant, but I cannot depend on the users to simply discover the side swiping gestures :/
Thank you for your help!
Check out the insertSubview:belowSubview: method of UIView.

How to hide a part of my UIView?

I have few other UI in my UIView and i have a UIButton on the top which i want to be hidden until unless the user scrolls to see the content on the very top and then display the UIButton.
Is there a way to implement this.
Thanks,
UIView (and thus everything sub-classing it) has a hidden property, this includes a UIButton. You can simply set this to YES/NO to hide/show something to the user.
After that the real question comes down to the show/hide criteria and how to measure it. If you are using a UIScrollView then you can add/implement UIScrollViewDelegate. This will give you methods like scrollViewDidScrollToTop: to check if the user scrolled to the top.
Keep track of the previous scroll offset so that with each scroll you can compute the delta, telling you whether the user scrolled up or down. With that, you can toggle the button's "hidden" property. Hope that helps.

How to change UIActionSheet view?

As I observed that UIActionSheet is always appearing from down side in iPhone,
but in some app, as I saw in AlarmClock, then two button became visible, one from upside and second from downside of iPhone,
What is that exactly, I can't understand, as far as I feel, it looks UIActionSheet,
I want such appearance for one of my app....
Help!
Yes just like Ole said, you can't customize UIActionSheet . But since it is just a simple subview you can create your personal "action sheet" by subviewing and animating. So if you want a button to appear on the top and one on the button, then create two UIViews resize them to the right size for your button, add your action sheet style background or any other background, add your button, connect your IBActions to the buttons and your IBOutlets to the views. Then when you want the buttons to appear animate them onto the screen (using sone CGRect, animation time and finally [UIView commitAnimations])
Probably just one or two custom views with a custom animation. UIActionSheet is not customizable so if you want something else than the default behavior you have to write it yourself. It's not that difficult.

I have a UI Scroll View with UIButtons on top. How do i make it scroll when they touch and drag the buttons?

I want something similar to how the iPhone homescreen works. I have my scrollview inside my main view, which scrolls to the right, but when you touch on the UIButtons, they become highlighted and dragging means they don't end up getting pressed but also the scrollview doesn't end up scrolling. It doesn't do this on the homescreen. How can i make it similar to this?
A touch-down-drag is a completely different event. Apple doesn't support this directly—you'd have to code it in—start tracking the touches using the gesture responders as soon as a touch-down-inside is detected, then scroll the same amount, and stop scrolling at a touch-up-outside (or inside). This would most likely fall under the category of unusual use of interface elements, and could very well get you rejected.
I think this is a better answer to the question:
UIScrollview with UIButtons - how to recreate springboard?

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.