UIKit 框架之UIImageView

简介:

//
//  ViewController.m
//  UIImageView
//
//  Created by City--Online on 15/5/18.
//  Copyright (c) 2015年 XQB. All rights reserved.
//
 
#import "ViewController.h"
 
@interface ViewController ()
 
@end
 
@implementation ViewController
 
- (void)viewDidLoad {
    [super viewDidLoad];
    UIImage *img=[UIImage imageNamed:@"2.jpg"];
    UIImage *img1=[UIImage imageNamed:@"3.jpg"];
    //基本属性
//    UIImageView *ImgView=[[UIImageView alloc]initWithImage:img highlightedImage:img1];
//    ImgView.frame=[UIScreen mainScreen].bounds;
//    ImgView.highlighted=YES;
//    [self.view addSubview:ImgView];
     
    //动画
    UIImageView *imgView=[[UIImageView alloc]initWithFrame:[UIScreen mainScreen].bounds];
    NSArray *animationImages=[[NSArray alloc]initWithObjects:img,img1, nil];
    imgView.highlightedAnimationImages=animationImages;
    imgView.animationImages=animationImages;
    imgView.animationRepeatCount=2;
    imgView.animationDuration=10;
//    - (void)startAnimating;
//    - (void)stopAnimating;
//    - (BOOL)isAnimating;
    [imgView startAnimating];
    [self.view addSubview:imgView];
     
}
 
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
 
@end

相关文章