佚名通过本文主要向大家介绍了请问重庆有相亲角没,请问羚羊角丝怎么煮,请问秋葵的种植方法,请问痔疮治疗的方法,请问化解小月建的方法等相关知识,希望对您有所帮助,也希望大家支持linkedu.com www.linkedu.com
问题: 请问这种带尖角的view有什么好的实现方法
描述:
解决方案1:
描述:
解决方案1:
美工 要个 图片解决
解决方案2:可以画一个出来,省了切图资源,效率也更高,方便复用。
- (UIView *)arrowView{
if (!_arrowView) {
// draw
CGSize size = CGSizeMake(kDefaultArrowWeight, kDefaultArrowHeight);
UIBezierPath *path = [[UIBezierPath alloc] init];
[path moveToPoint:CGPointMake(size.width / 2.0, 0)];
[path addLineToPoint:CGPointMake(0, size.height)];
[path addLineToPoint:CGPointMake(size.width, size.height)];
path.lineWidth = 1.0;
CAShapeLayer *arrowLayer = [CAShapeLayer layer];
arrowLayer.path = path.CGPath;
_arrowView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, size.width, size.height)];
_arrowView.layer.mask = arrowLayer;
_arrowView.backgroundColor = self.contentViewBackgroundColor;
}
return _arrowView;
}
解决方案3:做一个气泡图片,然后放个tableView在里面,做好固定的约束和图片的slicing设置后,可以试试这样行不行??