Search code examples
iosobjective-cuiviewuiviewanimationuiviewanimationtransition

slid-in view block my button responsiveness at the bottom of the view


I have a main view, and inside this view I have a button that animating another view to come from the bottom if the view to the middle (+-).

at the bottom of the view (slidingView) i have a cancel button, and this button is not responding after animating this view (slidingView)

it works like this:

self.slidingView.hidden = NO;
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.3];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
self.slidingView.frame = CGRectMake(0,0,320,284);
self.view.frame = CGRectMake(0,0,320,460);
[UIView commitAnimations];

if I dont animate, only do self.slidingView.hidden = NO; the button works perfectly.

why is that :// ?

obviously the problem is in here:

self.slidingView.frame = CGRectMake(0,0,320,284);
self.view.frame = CGRectMake(0,0,320,460); 

my sliding view:

x: 0 y: 284 w: 320 h: 284

my UIImageView (covering the sliding view):

x: 0 y: 0 w: 320 h: 284

my date picker:

x: 0 y: 53 w: 320 h: 162

my button is:

x: 15 y: 233 w: 136 h: 43

this is my interfacebuilder for that controller:

enter image description here

the sliding view has a uiimageview covering it as you can see, and two ui objects on that uiimageview which is the date picker and the button

but what is wrong..? i didnt implement autolayout yet so it works only on 4 inch thanks!


Solution

  • You have to make the animation placing your view where you want without touching self.view.