ios基础

作者: 大飞_2048 | 来源:发表于2020-04-01 17:27 被阅读0次

1、ios判断横竖屏

- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration{
    NSLog(@"UIViewController will rotate to Orientation: %ld", toInterfaceOrientation);

    if(([UIApplication sharedApplication].statusBarOrientation == UIInterfaceOrientationPortrait) || ([UIApplication sharedApplication].statusBarOrientation == UIInterfaceOrientationPortraitUpsideDown)){//横屏
        NSLog(@"横屏");
        self.pyTrendChart.frame = CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.height, [UIScreen mainScreen].bounds.size.width);

    }else{//竖屏
        NSLog(@"竖屏");
        self.pyTrendChart.frame = CGRectMake(0, 100, [UIScreen mainScreen].bounds.size.width, 280);
    }
}

2、synchronized < 锁底层含义--多总结,多看看>
https://www.jianshu.com/p/2dc347464188

相关文章

网友评论

      本文标题:ios基础

      本文链接:https://www.haomeiwen.com/subject/gaxbpctx.html