IOS basics-UIImageView, ios-uiimageview

Source: Internet
Author: User

IOS basics-UIImageView, ios-uiimageview

UIImage is to define an image, while UIImageVIew is to define a view, and then put the image in

-(Void) viewDidLoad {[super viewDidLoad]; // UIImageView * imageV = [[UIImageView alloc] initWithImage: [UIImage imageNamed: @ "1"] highlightedImage: [UIImage imageNamed: @ "2"]; UIImageView * imageV = [[UIImageView alloc] init]; imageV. frame = CGRectMake (100,100,150,300); // sets whether to allow users to interact with the control imageV. userInteractionEnabled = YES; // sets the image rendering color imageV. tintColor = [UIColor greenColor]; NSMutableArray * arrayM = [NSMutableArray array]; for (int I = 0; I <40; I ++) {NSString * name = [NSString stringWithFormat: @ "eat _ % 02d", I]; UIImage * image = [UIImage imageNamed: name]; [arrayM addObject: image];} // sets the image animation array imageV. animationImages = arrayM; // sets the number of playbacks. imageV. animationRepeatCount = 1; // set the total playback time to imageV. animationDuration = arrayM. count * 0.08; // start playing the animation [imageV startAnimating]; [self. view addSubview: imageV];}-(void) startAnimating {NSLog (@ "% s", _ func _);}-(void) stopAnimating {NSLog (@ "% s", _ func _);}-(BOOL) isAnimating {NSLog (@ "% s", _ func __); return YES ;}


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.