• 点击放大图片


    //创建button遮挡
    UIButton *cover = [[UIButton alloc]initWithFrame:self.view.frame];
    [cover setBackgroundColor:[UIColor blackColor]];
    cover.alpha = 0;
    [self.view addSubview:cover];
    [cover addTarget:self action:@selector(smallImg) forControlEvents:UIControlEventTouchUpInside];
    self.cover = cover;

    //image提前
    [self.view bringSubviewToFront:self.iconBtn];
    //改变frame
    [UIView animateWithDuration:0.25 animations:^{
    CGFloat w = self.view.frame.size.width;
    CGFloat y = (self.view.frame.size.height - w) * 0.5;
    self.iconBtn.frame = CGRectMake(0, y, w, w);
    cover.alpha = 0.7;
    }];

    - (void)smallImg{

        

        //改frame

        [UIView animateWithDuration:0.25 animations:^{

            self.iconBtn.frame = self.rect;

            self.cover.alpha = 0;

        }];

        //移除cover

        [self.cover removeFromSuperview];

        self.cover = nil;

        

    }

  • 相关阅读:
    数字麦克风PDM信号采集与STM32 I2S接口应用(四)--单片机源码
    Golang SQL连接池梳理
    Ghost-无损DDL
    蛮好用的网站
    齿轮
    water
    折纸 (模拟)
    不等式(数学)
    周期串查询
    大集训模拟赛十一
  • 原文地址:https://www.cnblogs.com/yangmx/p/4077827.html
Copyright © 2020-2023  润新知