ios开发 怎么设置一个视图的锚点
1个回答
2017-03-13
展开全部
刚刚找到答案:
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];
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |