我不知道它的iPhone版本是什么,但是在HTML中它是一个图像映射。地图的某些区域会把你带到不同的页面。我想使用一个图像,主要是在滚动视图中,我可以让某些区域执行不同的操作。例如,化学触觉( Chemical,http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=288060442&mt=8 )就是这样做的。点击一个元素,它就会变大,以显示更多的细节。这种技术的名称是什么,它是如何创建的?
我想与用户进行更多的交互,我怎样才能做到这些:
这里的任何建议都是非常感谢的。
发布于 2009-04-10 23:18:31
基本上,您需要做的是覆盖以下任何或全部:
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event;
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event;
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event;
- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event;在您的UIView子类中(或者实际上是UIResponder的任何子类)。然后你可以随意处理这个事件,比如做你在问题中提到的任何事情。
例如,以下是Apple用于简单事件处理程序的示例代码:
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
UITouch* touch = [touches anyObject];
NSUInteger numTaps = [touch tapCount];
if (numTaps < 2) {
[self.nextResponder touchesBegan:touches withEvent:event];
} else {
[self handleDoubleTap:touch];
}
}“事件处理应用程序编程指南”中的iPhone部分应该为您提供入门所需的所有信息。
https://stackoverflow.com/questions/736127
复制相似问题