Recently want to do a marquee effect, so write out the following code for the effect of the marquee ... However, the debug found that the animation can be performed under IOS6, but the animation is not performed under IOS7, and does not achieve the desired effect.
[_scrolllabel SizeToFit]; CGRect frame = _scrolllabel.frame; Frame.origin.x =; _scrolllabel.frame = frame; [UIView Setanimationsenabled:yes]; [UIView beginanimations:@ "Testanimation" context:null]; [UIView SETANIMATIONDURATION:10.F]; [UIView setanimationcurve:uiviewanimationcurvelinear]; [UIView setanimationdelegate:self]; [UIView Setanimationrepeatautoreverses:no]; [UIView setanimationrepeatcount:999999]; frame = _scrolllabel.frame; frame.origin.x =-frame.size.width; NSLog (@ "Frame orgin:%f", frame.origin.x); _scrolllabel.frame = frame; [UIView commitanimations];
And then on the internet to look up all kinds of information, have not solved ... Finally found that my view controller is a present modal view, in IOS7 under the modal view UIView there is a problem ... Decisively changed the present to push ... However, push does not reach the prensent effect, so it mimics present and implements present animations in the push view. The code is as follows:
First, push
Mclotterylistviewcontroller *list = [[Mclotterylistviewcontroller alloc]init]; List.modaltransitionstyle = uimodaltransitionstylecrossdissolve;// [self presentviewcontroller:list animated : YES completion:^{// // }]; [UIView Beginanimations:nil context:null]; [UIView setanimationcurve:uiviewanimationcurveeaseinout]; [UIView setanimationduration:0.75]; [Self.navigationcontroller pushviewcontroller:list Animated:no]; [UIView Setanimationtransition:uiviewanimationtransitioncurlup ForView:self.navigationController.view Cache:no]; [UIView commitanimations];
Second, pop
[UIView Beginanimations:nil context:null]; [UIView setanimationcurve:uiviewanimationcurveeaseinout]; [UIView setanimationduration:0.75]; [UIView setanimationtransition:uiviewanimationtransitioncurldown ForView:self.navigationController.view Cache:no] ; [UIView commitanimations]; [UIView Beginanimations:nil context:null]; [UIView setanimationdelay:0.375]; [Self.navigationcontroller Popviewcontrolleranimated:no]; [UIView commitanimations];
Reprint please indicate, error please correct me!