
-(UIView *)text
{ UIView *labelView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, YGScreenWidth, 100)]; labelView.backgroundColor = [UIColor whiteColor]; NSInteger toLeft = 10; NSArray *array = [NSArray arrayWithObjects:@"公司",@"职位",@"行业",@"年龄",@"性别",@"邮箱",@"附近",@"备注", nil]; int k = 0; CGFloat widthCount = 0.0f; int j = 0; NSInteger position = 4; for (int i = 0;iposition) {
j=j+1;
position = (j+1)*4;
k=0;
widthCount = 0.0f;
button.frame = CGRectMake(toLeft+widthCount+k*10, 10+35*j, labeWidth, 30);
widthCount = widthCount +labeWidth;
}
button.layer.cornerRadius = button.frame.size.height / 2;
button.layer.borderColor = colorWithLightGray.CGColor;
button.layer.borderWidth = 1;
k++;
[labelView addSubview:button];
}
labelView.frame = CGRectMake(0, 0, YGScreenWidth, 10+35*(j+1));
return labelView;
}
return一个view后把这个view添加到父view上,然后改变父view的高度即可
网友评论