zoukankan      html  css  js  c++  java
  • IOS小知识纪录

    1.scrollView缩放

    #import "ViewController.h"
    
    @interface ViewController () <UIScrollViewDelegate>
    @property (weak, nonatomic) IBOutlet UIScrollView *scrollView;
    @property (weak, nonatomic) IBOutlet UIImageView *mView;
    @end
    
    @implementation ViewController
    
    - (void)viewDidLoad {
        [super viewDidLoad];
    
        //1.设置内容尺寸
        self.scrollView.contentSize=self.mView.frame.size;
        
        //2.设置代理
        self.scrollView.delegate=self;
        
        //3.设置最大和最小的缩放比例  --设置之后才会有缩放效果
        self.scrollView.maximumZoomScale=2.0;
        self.scrollView.minimumZoomScale=0.2;
        
    }
    
    - (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView
    {
        return self.mView;
    }
    
    
    
    @end

     2.让ui主线程循环调用定时器

        self.timer =[NSTimer scheduledTimerWithTimeInterval:2.0 target:self selector:@selector(method) userInfo:nil repeats:YES];
        
        //让ui主线程 循环调用定时器
        [[NSRunLoop currentRunLoop] addTimer:self.timer forMode:NSRunLoopCommonModes];

    3.使用lable控件做一个圆

         label.frame = CGRectMake(0, 0, 100, 100);
         label.layer.cornerRadius = 50;
        //label.layer.masksToBounds=YES;
         label.clipsToBounds = YES;
  • 相关阅读:
    1059 C语言竞赛
    1058 选择题
    1057 数零壹
    1056 组合数的和
    1055 集体照
    Mysql--分库分表
    Mysql--改表结构
    Mysql--开始阶段
    Mysql--常用语句
    Mysql--grant授权
  • 原文地址:https://www.cnblogs.com/yangjingqi/p/4910076.html
Copyright © 2011-2022 走看看