ITeye博客

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

lgl903 · 2015-03-31 16:48 · IOS · 编程语言 · Markdown

UIView *line = [[UIViewalloc] init];

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

    line.backgroundColor =  TABLE_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)]];

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。