如何保存图像的当前位置?
我有一个应用程序,允许用户点击并在屏幕上移动 UITextField。有没有办法保存 UITextField 的当前位置?
I have a application that allows the user to tap and move a UITextField around the screen. Is there a way to save the current postion of the UITextField?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在头文件中的某个位置,您想要创建一个 CGPoint 来存储当前位置。您还需要一个方法来保存 UITextField 的当前位置:
当您想要保存当前位置时:
[self saveCurrentPosition];
saveCurrentPosition 应该如下所示:
Somewhere in your header file, you want to make a CGPoint that stores the current location. You also want a method to save the current location of the UITextField:
When you want to save the current position:
[self saveCurrentPosition];
saveCurrentPosition should look something like this: