如何在图像上创建热链接?

发布于 2024-07-16 11:18:15 字数 532 浏览 8 评论 0原文

我不确定它的 iPhone 版本叫什么,但在 HTML 中它是一个图像映射。 地图的某些区域会将您引导至不同的页面。 我想使用一个图像,主要是在滚动视图中,我可以让某些区域执行不同的操作。 例如,Chemical Touch,http:// itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=288060442&mt=8,执行此操作。 单击一个元素,它会变大以显示更多细节。 这种技术叫什么?它是如何创建的?

我想与用户进行更多的互动,我该如何做这些:

  • 将地图图钉放到该图像上
  • 显示 UITextField 取决于我在该区域中是否有文本
  • 覆盖文本取决于用户操作

这里的任何建议都非常好赞赏。

I'm not sure what the iPhone version of this is called but in HTML it is an image map. Certain areas of the map route you to different pages. I'd like to use an image, mostly in a scrollview, that I can have certain areas perform different actions. For example, Chemical Touch, http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=288060442&mt=8, does this. Click on an element and it grows in size to reveal more details. What is this type of technique called and how is it created?

I'd like to be a little more interactive with the user, how can I do any of these:

  • drop map pins onto this image
  • display a UITextField depending if I have text in that area
  • overlay text depending on user actions

Any suggestions here are greatly appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

撩起发的微风 2024-07-23 11:18:15

任何或全部:

- (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 应用程序编程指南中的事件处理部分应该为您提供入门所需的所有信息。

What you basically need to do is override any or all of:

- (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;

in your UIView subclass (or actually any subclass of UIResponder). Then you can handle the event however you wish, such as doing any of the things you mentioned in your question.

For example, here is Apple's sample code for a simple event handler:

- (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];
   }
}

The Event Handling section in the iPhone Application Programming Guide should give you all the info you need to get started.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文