天天看點

緩存

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

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

                                                           byRoundingCorners:UIRectCornerTopLeft | UIRectCornerTopRight

        } else {

        }

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

        if (indexPath.row == 1) {

    }

}

- (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];

繼續閱讀