zoukankan      html  css  js  c++  java
  • UIImageView

    #if 0

        NSString *path = [[NSBundle mainBundle] resourcePath ];

        NSString *imagePath = [NSString stringWithFormat:@"%@/qq.png",path];

        UIImage *image = [[UIImage alloc] initWithContentsOfFile:imagePath ];

    //   UIImage *image= [UIImage imageNamed:@"qq"]; //会缓存,程序结束时释放

        

        

        //载体

        UIImageView *imageView = [[UIImageView alloc]initWithImage:image];

        imageView.frame = CGRectMake(10, 100, 355, 400);

        

        //内容模式:默认UIViewContentModeScaleToFill

        imageView.contentMode = UIViewContentModeCenter;

        /*

         typedef NS_ENUM(NSInteger, UIViewContentMode) {

         UIViewContentModeScaleToFill,

         UIViewContentModeScaleAspectFit,      // contents scaled to fit with fixed aspect. remainder is transparent

         UIViewContentModeScaleAspectFill,     // contents scaled to fill with fixed aspect. some portion of content may be clipped.

         UIViewContentModeRedraw,              // redraw on bounds change (calls -setNeedsDisplay)

         UIViewContentModeCenter,              // contents remain same size. positioned adjusted.

         UIViewContentModeTop,

         UIViewContentModeBottom,

         UIViewContentModeLeft,

         UIViewContentModeRight,

         UIViewContentModeTopLeft,

         UIViewContentModeTopRight,

         UIViewContentModeBottomLeft,

         UIViewContentModeBottomRight,

         };

         

         */

        

        [self.view addSubview:imageView];

    #endif

        //UIImageView动画,-- 播放序列图

        NSMutableArray *imageArray = [[NSMutableArray alloc]init];

        for (NSInteger i = 1; i<=13; i++) {

            UIImage *image = [UIImage imageNamed:[NSString stringWithFormat:@"png%zd.png",i]];

            [imageArray addObject:image];

        }

        UIImageView *imageView= [[UIImageView alloc]init];

        imageView.frame = CGRectMake((375-207)/2, 100, 207, 217);

        [self.view addSubview:imageView];

        //设置动画数组

        imageView.animationImages = imageArray;

        //设置播放周期时间

        imageView.animationDuration = 2;

        //执行次数,给0不限制次数

        imageView.animationRepeatCount = 10;

        [imageView startAnimating];

    //    [imageView stopAnimating];

  • 相关阅读:
    Fix RICHTX32.OCX Issue on Windows 7
    Solved: c:\windows\system32\config\systemprofile\desktop
    递归的现实应用
    Win 8 app 获取窗口的宽度和高度, 本地化, 及文本读取
    均匀设计U Star 665
    GridView.ScrollIntoView() doesn't work
    XML节点访问与更新
    Keyboard supports in Software Testing
    WordPress程序备受喜爱的原因:十八般武艺
    paypal注册教程(PP注册教程)paypal使用方法
  • 原文地址:https://www.cnblogs.com/PJXWang/p/5425580.html
Copyright © 2011-2022 走看看