总结:1、在iTouch4上运行检测到的触摸点数最大是5,即只允许5个手指在屏幕上滑动2、视图支持多点触摸:isMultipleTouchEnabled返回YES,或者设置 multipleTouchEnabled属性为YES3、要将多个CGPoint点添加到NSMutableArray,使用 NSStringFromCGPoint 函数,使用 CGPointFromString 从数组中取出坐标TouchesView.h#import <UIKit/UIKit.h>@interface TouchesView : UIView { NSMutableArray* _points; Read More
posted @ 2011-10-22 20:22 张云贵 Views(841) Comments(2) Diggs(0) Edit
总结:1、单点触摸时,获取坐标:[[touches anyObject] locationInView:self];2、需要更新图形显示内容时,调用 [self setNeedsDisplay];3、在绘图事件函数中使用 UIGraphicsGetCurrentContext() 得到画布4、画线使用 StrokePath5、绘图前清除旧的显示内容可使用背景色填充视图范围(本例中可以不要)6、绘图程序一般要支持屏幕自动旋转,在视图控制器的shouldAutorotateToInterfaceOrientation函数中返回YESTouchesView.h:#import <UIKit/U Read More
posted @ 2011-10-22 19:21 张云贵 Views(930) Comments(0) Diggs(0) Edit