• 12345的789


    UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:self.backView.bounds

                                                               byRoundingCorners:UIRectCornerBottomLeft | UIRectCornerBottomRight

                                                                     cornerRadii:CGSizeMake(12.f, 12.f)];

                CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];

                maskLayer.frame = self.backView.bounds;

                maskLayer.path = maskPath.CGPath;

                self.backView.layer.mask = maskLayer;

    - (void)refreshBackgroundCornerRadius:(NSIndexPath *)indexPath {

        self.backView.layer.cornerRadius = 0;

        

        if (indexPath.section == 0) {

            if (indexPath.row == 3) {

                UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:self.backView.bounds

                                                               byRoundingCorners:UIRectCornerBottomLeft | UIRectCornerBottomRight

                                                                     cornerRadii:CGSizeMake(12.f, 12.f)];

                CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];

                maskLayer.frame = self.backView.bounds;

                maskLayer.path = maskPath.CGPath;

                self.backView.layer.mask = maskLayer;

                

            } else if (indexPath.row == 0) {

                UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:self.backView.bounds

                                                               byRoundingCorners:UIRectCornerTopLeft | UIRectCornerTopRight

                                                                     cornerRadii:CGSizeMake(12.f, 12.f)];

                CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];

                maskLayer.frame = self.backView.bounds;

                maskLayer.path = maskPath.CGPath;

                self.backView.layer.mask = maskLayer;

            } else {

                

            }

        }else if(indexPath.section == 1){

            if (indexPath.row == 1) {

                UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:self.backView.bounds

                                                               byRoundingCorners:UIRectCornerBottomLeft | UIRectCornerBottomRight

                                                                     cornerRadii:CGSizeMake(12.f, 12.f)];

                CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];

                maskLayer.frame = self.backView.bounds;

                maskLayer.path = maskPath.CGPath;

                self.backView.layer.mask = maskLayer;

                

            } else if (indexPath.row == 0) {

                UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:self.backView.bounds

                                                               byRoundingCorners:UIRectCornerTopLeft | UIRectCornerTopRight

                                                                     cornerRadii:CGSizeMake(12.f, 12.f)];

                CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];

                maskLayer.frame = self.backView.bounds;

                maskLayer.path = maskPath.CGPath;

                self.backView.layer.mask = maskLayer;

            } else {

                

            }

        }

    }

    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

        YGProfileCell *profileCell = [tableView dequeueReusableCellWithIdentifier:YGMainProfileCellID];

        profileCell.backgroundColor = [UIColor clearColor];

        profileCell.selectionStyle = UITableViewCellSelectionStyleNone;

        

        [profileCell refreshProfileCell:self.profileDatas[indexPath.section][indexPath.row]];

        [profileCell refreshBackgroundCornerRadius:indexPath];

        

        return profileCell;

    }

    - (UITableView *)tableView {

        if ( !_tableView ) {

            _tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain];

            _tableView.backgroundColor = [UIColor clearColor];

            _tableView.bounces = NO;

            _tableView.delegate = self;

            _tableView.dataSource = self;

            _tableView.separatorStyle = UITableViewCellSeparatorStyleNone;

            _tableView.showsVerticalScrollIndicator = NO;

            _tableView.sectionFooterHeight = 12;

            [_tableView registerClass:[YGProfileCell class] forCellReuseIdentifier:YGMainProfileCellID];

        }

        

        return _tableView;

    }

    #pragma mark - NSLog

    #ifdef DEBUG

    #define LCLog(fmt, ...) NSLog(@"%s [Line %d] %s ", __FUNCTION__, __LINE__, [[NSString stringWithFormat:fmt, ## __VA_ARGS__] UTF8String]);

    #else

    #define LCLog(...)

    #endif

    NSStringFromSelector(_cmd)

    #define ValidStr(str) ([str isKindOfClass:[NSString class]] && str.length ? str : @"")

    #define ValidDic(dic) ([dic isKindOfClass:[NSDictionary class]] && dic ? dic : [NSDictionary dictionary])

    #define ValidArr(arr) ([arr isKindOfClass:[NSArray class]] && arr ? arr : [NSArray array])

    + (BOOL)isIphoneXx{

        BOOL isIphoneXx = NO;

        if (@available(iOS 11.0, *)) {

            UIWindow *mainWindow = [UIApplication sharedApplication].windows.firstObject;

            if (mainWindow.safeAreaInsets.bottom > 0.f) {

                isIphoneXx = YES;

            }

        }

        return isIphoneXx;

    }

    提高技能如同提升自信心。
  • 相关阅读:
    第三章 传奇的开始--Delphi(附读书笔记)
    南沙才是根本,进军西太平洋就是一个伪命题
    Qt之自定义插件(for Qt Designer)
    人类本来就是在无奈中前进的
    亚投行国家分工非常明确,一路一带是欧亚大融合之路,欢呼吧!
    冒泡排序
    webkit中DOM 事件有多少
    在TMemo上画一条线(超级简单,举一反三)
    判断系统64位(使用GetNativeSystemInfo函数,XP时代就有这个函数了)
    项目的大小衡量标准,以及项目演进的方法(填空架子,持续集成,边开发边测试效果)
  • 原文地址:https://www.cnblogs.com/chims-liu-touch/p/14472235.html
Copyright © 2020-2023  润新知