一、纵分割线
//x y high 改为你的位置
UIView *verticalLine = [[UIView alloc]initWithFrame:CGRectMake(x, y , 1, high)];
verticalLine.backgroundColor = [UIColor blueColor];
[self.contentView addSubview:verticalLine];
二、横分割线
//x y width 改为你的位置
UIView *horizontalLine = [[UIView alloc]initWithFrame:CGRectMake(x, y, width, 1)];
horizontalLine.backgroundColor = [UIColor blueColor];
[self.contentView addSubview:horizontalLine];
如果是在一般视图划线,将contentView改为view就可以了。