---
title: "[IOS]自定义TableViewCell分割线和右剪头"
author: "lgl903"
date: "2015-03-31T16:48:35Z"
tags: []
categories: ["编程语言"]
slug: "ios-tableviewcell"
draft: false
lastmod: "2015-03-31T16:49:47Z"
id: 2197449
url: "https://lgl903.iteye.com/blog/2197449"
---

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