• iOS 添加阴影后 屏幕卡顿 抖动


    - (void)awakeFromNib {
        // Initialization code
        _btnViews.layer.shadowPath =[UIBezierPath bezierPathWithRect:_btnViews.bounds].CGPath;
        _btnViews.layer.shadowColor = [UIColor grayColor].CGColor;//shadowColor阴影颜色
        _btnViews.layer.shadowOffset = CGSizeMake(0,3);//shadowOffset阴影偏移,x向右偏移4,y向下偏移4,默认(0, -3),这个跟shadowRadius配合使用
        _btnViews.layer.shadowOpacity = 0.5;//阴影透明度,默认0
        _btnViews.layer.shadowRadius = 2;//阴影半径,默认3
        
        
        _labAuthorTitle.layer.shadowPath =[UIBezierPath bezierPathWithRect:_labAuthorTitle.bounds].CGPath;
        _labAuthorTitle.layer.shadowColor = [UIColor grayColor].CGColor;//shadowColor阴影颜色
        _labAuthorTitle.layer.shadowOffset = CGSizeMake(2,2);//shadowOffset阴影偏移,x向右偏移4,y向下偏移4,默认(0, -3),这个跟shadowRadius配合使用
        _labAuthorTitle.layer.shadowOpacity = 0.5;//阴影透明度,默认0
        _labAuthorTitle.layer.shadowRadius = 2;//阴影半径,默认3
        
        _labAuthorSubTitle.layer.shadowPath =[UIBezierPath bezierPathWithRect:_labAuthorSubTitle.bounds].CGPath;
        _labAuthorSubTitle.layer.shadowColor = [UIColor grayColor].CGColor;//shadowColor阴影颜色
        _labAuthorSubTitle.layer.shadowOffset = CGSizeMake(2,2);//shadowOffset阴影偏移,x向右偏移4,y向下偏移4,默认(0, -3),这个跟shadowRadius配合使用
        _labAuthorSubTitle.layer.shadowOpacity = 0.5;//阴影透明度,默认0
        _labAuthorSubTitle.layer.shadowRadius = 2;//阴影半径,默认3
       
       
    }
    

     如上,给Cell添加完阴影后 ,屏幕出现卡顿现象,tableview 拖动时有抖动现象。

    增加此句就OK了。

    _labAuthorSubTitle.layer.shadowPath =[UIBezierPath bezierPathWithRect:_labAuthorSubTitle.bounds].CGPath;
  • 相关阅读:
    Python基础之列表功能
    python基础之字符串基本功能
    Linux服务器上搭建codis集群之——安装前环境准备
    centos7环境开启WIFI热点
    升级glibc、gcc、zlib等
    修复Nginx 502错误:upstream sent too big header while reading response header from upstream
    PS 命令详解
    Linux下网络文件系统NFS服务搭建易错点总结
    2020美赛建模竞赛一等奖经验心得分享
    团队获奖总结
  • 原文地址:https://www.cnblogs.com/unintersky/p/5018442.html
Copyright © 2020-2023  润新知