zoukankan      html  css  js  c++  java
  • 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;
  • 相关阅读:
    鼠标跟随效果 vue或者js通用
    element 多个文件上传多次http请求解决方法
    快速判断数组中值是否重复
    vue-resource+element upload上传(遇到formData总是变为object格式)
    element UI 下拉菜单滚动监听(vue指令)
    echarts环形图自动定位radius
    echarts地图散点高亮弹框制作
    js实现table表格相同内容按需合并
    element ui表格相同内容自动合并
    hadoop yarn
  • 原文地址:https://www.cnblogs.com/unintersky/p/5018442.html
Copyright © 2011-2022 走看看