UIColor *taskColor = [UIColor colorWithRed:0.98f green:0.92f blue:0.80f alpha:1.0f];
UIButton *taskBtn = [[UIButton alloc] initWithFrame:CGRectMake(40, 150, 280, 160)];
taskBtn.backgroundColor = taskColor;
CALayer *bottomBorder = [CALayer layer];
float
height=taskBtn.frame.size.height-1.0f;
float
width=taskBtn.frame.size.width;
bottomBorder.frame = CGRectMake(0.0f, height, width, 1.0f);
bottomBorder.backgroundColor = [UIColor redColor].CGColor;
[taskBtn.layer addSublayer:bottomBorder];
Tableview边框
http://bbs.csdn.net/topics/330190149
style="border:1px solid #ccc;border-top:none;border-bottom:none;"
例子 1
border-width:thin medium thick 10px;上边框是细边框
右边框是中等边框
下边框是粗边框
左边框是 10px 宽的边框
例子 2
border-width:thin medium thick;上边框是 10px
右边框和左边框是中等边框
下边框是粗边框
例子 3
border-width:thin medium;上边框和下边框是细边框
右边框和左边框是中等边框
例子 4
border-width:thin;所有 4 个边框都是细边框