我用的是Masonry布局.
我想绘制如箭头所示的部分圆角按钮.请问用代码怎么实现?
在哪个方法里面写?
code:
//部分圆角按钮
UIButton *loggedBtn = [[UIButton alloc]init];
loggedBtn.backgroundColor = [UIColor blueColor];
[headView addSubview:loggedBtn];
[loggedBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.offset(40);
make.height.offset(20);
make.right.equalTo(headView);
make.centerY.equalTo(headView);
}];
Can’t we just find a picture with partially rounded corners?
Just modify the button’s layer. Change to the rounded corners you want, and add the background color. There are these APIs in the layer, you can take a look.
It can be modified by programmers, but I think the easiest way is to ask the artist to provide it directly. There is no need to bother programmers on this issue, hehe
I will give you my code directly. You should know how to modify my code to achieve the effect you want after taking a look at it