触摸并从一个视图拖动到另一个视图

发布于 2024-08-26 00:14:49 字数 349 浏览 3 评论 0原文

我已经在这个问题上寻找了一些线索,但没有取得太大成功。希望有人能把我踢向正确的方向。

我正在制作几个应用程序的原型,我需要在其中设计自己的 GUI。 GUI 由两个独立的 UIView 组成,其中一个包含图像的小拇指。我希望能够将这个拇指从第一个视图拖动到另一个视图。就这么简单!但我还没弄清楚这是如何做到的。这是我正在寻找的确切流程:

  • 触摸拇指
  • 动画拇指的小放大
  • 拖动拇指到另一个 UIView
  • 放置拇指
  • 动画缩小拇指

不是特别奇怪,但拇指仍然与第一个视图相关时间。我尝试通过第一个视图超级视图移动拇指,然后返回第二个视图,但没有运气。

I've search for some clues on this problem without much success. Hope someone can kick me in the right direction.

I am prototyping a couple of apps where I need to design my own GUI. The GUI is made up by two separated UIViews where one of them contains a small thumb of an image. I want to be able to drag this thumb from the first view to the other. Simple as that! But I haven't figured out how this is done. Here is the exact flow I am looking for:

  • touch the thumb
  • animate a small enlargement of the thumb
  • drag the thumb to the other UIView
  • drop the thumb
  • animate a shrink of the thumb

Not particularly strange, but the thumb remains related to the first view all the time. I've tried to move the thumb via the first views superview and then back to the second view, but with no luck.

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

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

发布评论

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

评论(1

一张白纸 2024-09-02 00:14:49

如果问题是“如何将 UIView 从一个超级视图移动到另一个超级视图?”,答案是:

[myNewSuperview addSubview:myThumbView];

If the question is "How to move a UIView from one superview to another?", the answer is:

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