Created
September 6, 2013 03:10
-
-
Save warriorg/6459049 to your computer and use it in GitHub Desktop.
UIImageView切换图片
From http://www.cnblogs.com/foxmin/archive/2012/04/13/2445612.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*======================================================= | |
更新图片显示 | |
========================================================*/ | |
-(void)ChangeImage{ | |
CGContextRef context = UIGraphicsGetCurrentContext(); | |
[UIView beginAnimations:nil context:context]; | |
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut]; | |
[UIView setAnimationDuration:0.5]; //动画长度,单位为秒 | |
[self.view setAlpha:1]; | |
[myimageview setAlpha:1]; | |
[myimageview setImage:[imgArray objectAtIndex:Page]]; | |
//[myimageview setAnimationRepeatCount:4]; //设置重复次数 | |
[UIView commitAnimations]; | |
self.navigationItem.title = [NSString stringWithFormat:@"%d/%d",Page+1,[imgArray count]]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment