在我的主视图控制器中,按钮操作是
-(IBAction)ChangeImage
{
UIImage *guns = [UIImage imageNamed:@"guns.png"]; // load our image resource
imageView = [[UIImageView alloc] initWithImage:guns];
NSLog(@"kaam hua..??");
[self.view addSubview:imageView];
[UIView transitionFromView:self.view
toView:imageView
duration:3.0f
options:UIViewAnimationOptionTransitionCrossDissolve
completion:nil];
NSLog(@"hfhjlkhbjhdfcvkbjnlkhgj");
}
答案 0 :(得分:0)
您可以在动画选项中使用 UIViewAnimationOptionCurveEaseIn ,
试试这个,
CGRect or=self.view.frame;
CGRect basketTopFrame = self.view.frame;
basketTopFrame.origin.x = basketTopFrame.size.width;
self.view.frame = basketTopFrame;
[UIView animateWithDuration:0.2
delay:0.0
options: UIViewAnimationOptionCurveEaseIn
animations:^{
[self.view addSubview:imageView];
}
completion:^(BOOL finished){
NSLog(@"Done!");
}];