In ios, move the view to the left, and the right side does not move
In ios, the view is moved to the left, and the right side is not moved by Wu xueying
-(void)signUpAndLoginAnimation:(BOOL)showSignUp { CGFloat LogInWidthChange = (showSignUp)?-120:120; [UIView animateWithDuration:0.3f animations:^{ CGRect newFrame = self.logInView2.frame; newFrame.origin.x -= LogInWidthChange; newFrame.size.width += LogInWidthChange; CGFloat newSizeX = self.logInView2.frame.size.width + LogInWidthChange; CGFloat ofsetX = LogInWidthChange; [self.logInView2 setFrame:CGRectMake(self.logInView2.frame.origin.x-ofsetX, self.logInView2.frame.origin.y, newSizeX, self.logInView2.frame.size.height)]; }];}
It is found that writing is complicated:
[UIView animateWithDuration:0.3f animations:^{ CGFloat changeWidth = (showSignUp)?-120:120; [self.logInView2 setFrame:CGRectMake(self.logInView2.left-changeWidth, self.logInView2.top, self.logInView2.width + changeWidth, self.logInView2.height)]; }];