In my project I have a simple animation, I just move a view from left to right. This works fine in iOS 6, but when I run in iOS 7 it does not do anything. Does someone know why? If the animation is very simple how can I fix this for iOS 7? My code is:
- (void) showAnimation
{
if (IS_IPAD())
{
[UIView animateWithDuration:50.0f
delay:1
options:UIViewAnimationOptionRepeat
animations:^{
ViewBOLIVIA.frame = CGRectMake(1024,0, ViewBOLIVIA.frame.size.width, ViewBOLIVIA.frame.size.height);
} completion:nil];
}
else
{
if (IS_IPHONE_5)
{
[UIView animateWithDuration:50.0f
delay:1
options:UIViewAnimationOptionRepeat
animations:^{
ViewBOLIVIA.frame = CGRectMake(568,0, ViewBOLIVIA.frame.size.width, ViewBOLIVIA.frame.size.height);
} completion:nil];
}
else
{
[UIView animateWithDuration:50.0f
delay:1
options:UIViewAnimationOptionRepeat
animations:^{
ViewBOLIVIA.frame = CGRectMake(480,0, ViewBOLIVIA.frame.size.width, ViewBOLIVIA.frame.size.height);
} completion:nil];
}
}
}
I did update and Im using Xcode 5 and iOS 7 so any help guys, do you know how fix this?
OK I think I resolved it. Before iOS 7 it was okay to have animations running in viewDidLoad with storyboards. If you move your animation calls to - (void)viewDidAppear
then they should start working again. So in your case you will want to call [self showAnimation];
in - (void)viewDidAppear
.
- (void)viewDidAppear{
[self showAnimation];
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With