zoukankan      html  css  js  c++  java
  • 0108 点击时 大小图

    1.  

      /**

       *  大图功能

       */

      - (IBAction)big {

      //    1.添加阴影

          UIButton *cover = [[UIButton alloc]init];

          cover.frame = self.view.bounds;

          [self.view addSubview:cover];

          cover.backgroundColor = [UIColor blackColor];

          cover.alpha = 0.0;

          self.cover = cover;

      //     1.1给阴影添加点击事件

          [cover addTarget:self action:@selector(smallImage) forControlEvents:UIControlEventTouchUpInside];

      //     2调整位置

          [self.view bringSubviewToFront:self.head];//head到最前边

      //     3.修改headframe

          [UIView beginAnimations:nil context:nil];

        

          [UIView setAnimationDuration:1.5];

          cover.alpha = 0.6;

          

          CGFloat headW = self.view.frame.size.width;

          CGFloat headH = headW;

          CGFloat headX = 0;

          CGFloat headY = ( self.view.frame.size.height - headH)*0.5;

          self.head.frame = CGRectMake(headX, headY, headW, headH);

          [UIView commitAnimations];

          

          

          

          

      }

       

      /**

       *  小图功能的点击

       */

      - (void)smallImage{

      ////    1.阴影移除

      //    [self.cover removeFromSuperview];

      ////    2.修改头像frame

      //    self.head.frame = CGRectMake(97, 145, 180, 180);

          

          [UIView animateWithDuration:1.5 animations:^{

              self.cover.alpha = 0.0;

              self.head.frame = CGRectMake(97, 145, 180, 180);

          } completion:^(BOOL finished) {

              [self.cover removeFromSuperview];

              self.cover = nil;

          }];

          

          

          

      }

  • 相关阅读:
    团队事后分析
    Gamma阶段发布说明
    Gamma阶段 测试报告
    【Gamma阶段】第十次Scrum Meeting
    【Gamma阶段】第九次Scrum Meeting
    【Gamma阶段】第八次Scrum Meeting
    Gamma展示
    【Gamma阶段】第七次Scrum Meeting
    【Gamma阶段】第六次Scrum Meeting
    【Gamma阶段】第五次Scrum Meeting
  • 原文地址:https://www.cnblogs.com/gzz2016/p/5113479.html
Copyright © 2011-2022 走看看