UIBezierPath简单实现带箭头view
自定义一个view,在里面划线添加ui
#import "BeazView.h"
@implementation BeazView
-(instancetype)initWithFrame:(CGRect)frame{
self = [super initWithFrame:frame];
if (self) {
[self dosomething];
}
return self;
}
-(void)dosomething{
_bezierPath4 = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(10, 20, self.frame.size.width-20, 100) byRoundingCorners:UIRectCornerAllCorners
cornerRadii:CGSizeMake(10, 10)];
[_bezierPath4 moveToPoint:CGPointMake(100, 0)];
[_bezierPath4 addLineToPoint:CGPointMake(80, 20)];
[_bezierPath4 addLineToPoint:CGPointMake(120, 20)];
_shaperLayer4 = [CAShapeLayer new];
_shaperLayer4.fillColor = [UIColor orangeColor].CGColor;
[self.layer addSublayer:_shaperLayer4];
【UIBezierPath简单实现带箭头view】_shaperLayer4.path = _bezierPath4.CGPath;
_title = [[UILabel alloc]initWithFrame:CGRectMake(10, 20, self.frame.size.width-20, 100)];
_title.text = @"我在上面";
_title.textColor = [UIColor redColor];
[self addSubview:_title];
}
文章图片
定义一个按钮,实现移除
[UIView animateWithDuration:0.02 animations:^{
[view removeFromSuperview];
} completion:^(BOOL finished) {
}];
推荐阅读
- 关于QueryWrapper|关于QueryWrapper,实现MybatisPlus多表关联查询方式
- MybatisPlus使用queryWrapper如何实现复杂查询
- python学习之|python学习之 实现QQ自动发送消息
- 科学养胃,别被忽悠,其实真的很简单
- 孩子不是实现父母欲望的工具——林哈夫
- opencv|opencv C++模板匹配的简单实现
- Node.js中readline模块实现终端输入
- java中如何实现重建二叉树
- 松软可口易消化,无需烤箱超简单,新手麻麻也能轻松成功~
- 人脸识别|【人脸识别系列】| 实现自动化妆