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

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.

Related

SWRevealViewController Pan gesture is not working when the from view is scrolling enabled

I have a side menu which is impelemented by SWRevealViewController and my frontView has a collection view.
SWReveal works fine by tap on menu button, but the pen gesture is not working on collection view (which has a horizontal scrolling enabled).
can any one help me to force collection view to accept the pen gesture of the SWReveal?
SWRevealViewController's gesture controller and collection view are been clashing that's why the problem occurs. Other than that as per my view there is no practical way to identify what user wants to open by the gesture.
But Client needs a solution and the image shows it! keep user interaction ON of the view.
Let me know if you find anything else.
Best of luck.
Add below code in viewDidLoad
self.view.addGestureRecognizer(revealViewController().panGestureRecognizer())

How to tell VoiceOver that a control has animated away?

User taps control and a different view comes up, animated. VoiceOver still highlights the removed control and it is stuck. User can't interact with the view.
This is not in a UIViewController but a custom UIView subclass.
How to tell VoiceOver to update its presentation or state when something appeared or disappeared with animation?
You can post an accessibility notification to indicate that the layout or the full screen of content has changed and select a new element.
UIAccessibilityPostNotification(UIAccessibilityLayoutChangedNotification
elementToSelect);

Scrolling fails if clicking on child

I have a UIScrollView which has a bunch of UIButtons as children.
If I click outside of these buttons, I am able to scroll the UIScrollView. However, if I try to scroll by clicking on one of these buttons, the scrollview doesn't work.
Each button is registered to listen to UIControlEventTouchUpInside.
Any ideas?
If you're touching the button and hoping to scroll, then you should be linking to the UIControlEventTouchDownInside event, not outside!
Additionally, you have to pass the touch event to the underlying UIScrollView to make the scrolling happen. The app is actually trying to do you a favor by letting you click the button and not scrolling the table.
Good luck

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

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.

UIButton disabled when covered (or semi covered) by a view

I have a view that holds some UIButtons. Another view covers and hides the buttons. When the top view slides off to reveal the buttons (with an animation).. the UI draws the buttons grayed out until the top view no longer covers or overlaps the buttons at all.. causing an undesirable flicker from gray to the normal button color (white).
is there a way to keep the UIButton from rendering itself disabled while covered or semi covered by another view?
I dont think that its correct that a button is disabled while covered. What is happening is that when its covered, touch events are prevented from getting to the button, so the button cant get pressed. If the button is only partially covered, touch events to that part that are not covered can be received by the button and the button can be depressed. If you really wanted the button to work while it was covered (maybe you can relayer your views so the button is in front of the view instead of behind it?) you could hack your view and void its hit testing so it doesnt capture the touches.
Well, in lieu of actually finding the correct answer, I simply swapped out the buttons with UIImageViews and attached UITapGestureRecognizers to them... this solved the problem.