[IOS]自定义TableViewCell分割线和右剪头

    UIView *line = [[UIViewalloc] init];

    line.frame = CGRectMake(0, cell.frame.size.height, SCREEN_WIDTH, 1);

    line.backgroundColorTABLE_CELL_LINE_COLOR;

    [cell.contentViewaddSubview:line];

 

 

 

    UIImageView *arrowView=[[UIImageViewalloc] init];

    arrowView.translatesAutoresizingMaskIntoConstraints=NO;

    arrowView.image=[UIImageimageNamed:@"setting_arrow"];

    [cell.contentViewaddSubview:arrowView];

    

    [cell.contentViewaddConstraints:[NSLayoutConstraintconstraintsWithVisualFormat:@"V:[arrowView(15)]-15-|"options:0metrics:nilviews:NSDictionaryOfVariableBindings(arrowView)]];

 

    [cell.contentViewaddConstraints:[NSLayoutConstraintconstraintsWithVisualFormat:@"H:[arrowView(10)]-20-|"options:0metrics:nilviews:NSDictionaryOfVariableBindings(arrowView)]];

猜你喜欢

转载自lgl903.iteye.com/blog/2197449