IOS - 横线跟竖线
IOS - 横线和竖线
横线:
UIView *horizontalLine = [[UIView alloc]initWithFrame:CGRectMake(x, y, viewWidth(), 1)];
horizontalLine.backgroundColor = [UIColor grayColor];
[self.view addSubview:horizontalLine];
[horizontalLine release];
竖线
UIView *verticalLine = [[UIView alloc]initWithFrame:CGRectMake(x cordinate, y cordinate, 1, viewWidth())];
verticalLine.backgroundColor = [UIColor grayColor];
[self.view addSubview:verticalLine];
[verticalLine release];
屏幕宽度
CGFloat viewWidth() {
static CGFloat viewWidth = 0;
if (viewWidth == 0) {
viewWidth = CYScreenBounds().size.width;
}
return viewWidth;
}
版权声明:本文为博主原创文章,未经博主允许不得转载。