码迷,mamicode.com
首页 > 其他好文 > 详细

UIKit 框架之UIImageView

时间:2015-05-18 12:43:36      阅读:106      评论:0      收藏:0      [点我收藏+]

标签:

//
//  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

 

UIKit 框架之UIImageView

标签:

原文地址:http://www.cnblogs.com/cuiyw/p/4511270.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!