刚学ios 开发,之前搞android,我想在View上面绘制路径,按照我的手的滑动路径,目前只能是画一个直线,请大家指导下,API还不熟悉,谢谢了
解决方案 »
- search bar和tableview结合的问题
- 求教一个基础性问题
- 进入Iphone开发的一些问题
- 安卓和ios系统,如何能快速截屏录制用户操作,且不影响用户对应用的体验
- IOS emoji特殊字符导致部分字体变粗
- iphone 传json 字符串到webSercie
- 在IOS6中UITableViewCell显示不全
- id <UITableViewDataSource> dataSource
- VMware安装mac问题
- swift 菜鸟求助 如何做到app在每次重新唤醒的时候都弹出一个全屏的输入密码界面
- objective-c中的@package是什么意思
- 用vmware虚拟机安装雪豹苹果系统的问题。
具体使用的话可以这样:-(void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
UITouch *touch = [touches anyObject];
self.currentPath = [UIBezierPath bezierPath];
currentPath.lineWidth = 10.0;
[currentPath moveToPoint:[touch locationInView:self]];
[paths addObject:self.currentPath];
}-(void) touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
UITouch *touch = [touches anyObject];
[self.currentPath addLineToPoint:[touch locationInView:self]];
[self setNeedsDisplay];
}-(void) touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
UITouch *touch = [touches anyObject];
for (UIBezierPath *path in paths) {
[path removeAllPoints];
}