zoukankan      html  css  js  c++  java
  • UIView--UIImageView

    1.contentMode

    view.contentMode = UIViewContentModeScaleAspectFill;

    2.是否实现触摸

        

    3.简单实现动画 图片的名字为campFire01-campFire17

        NSMutableArray * imagearray = [NSMutableArray array];

        for (int i = 1; i<=17; i++) {

            //拼接图片的名字

            NSString *name = [NSString stringWithFormat:@"campFire%@%d",i<10?@"0":@"",i];

            //NSString *name = [NSString stringWithFormat:@"campFire%02d",i];

            UIImage * image = [UIImage imageNamed:name];

            [imagearray addObject:image];

        }

        UIImageView * view = [[UIImageView alloc]initWithFrame:CGRectMake(40, 40, 320-80, 568-80)];

        view.contentMode = UIViewContentModeScaleAspectFit;

        view.animationImages = imagearray;//直接接受数组

        view.animationDuration = 2;//时间

        view.animationRepeatCount = 0;//重复多少次 0表示无数次

        [view startAnimating];

    4.拉伸

    - (UIImage *)stretchableImageWithLeftCapWidth:(NSInteger)leftCapWidth topCapHeight:(NSInteger)topCapHeight

    这个函数是UIImage的一个实例函数,它的功能是创建一个内容可拉伸,而边角不拉伸的图片,需要两个参数,第一个是左边不拉伸区域的宽度,第二个参数是上面不拉伸的高度。

     

  • 相关阅读:
    如何把两个查询语句合成一条 语句
    SpringBoot之springfox(Swagger) (ApiDoc接口文档)
    springboot + swagger
    高等数学(上)第2章——导数与微分
    oracle 常用 sql
    线性代数基础知识(三)—— 矩阵乘法
    Neo4j(一)
    医学知识图谱(二)——应用
    医学知识图谱一
    数学基本概念
  • 原文地址:https://www.cnblogs.com/huoran1120/p/5141366.html
Copyright © 2011-2022 走看看