ios - 可以拖动到 View Controller 中任何位置的 float 按钮?

标签 ios objective-c iphone

看到很多关于创建 float 按钮的问题,效果很好。但是是否可以拖动按钮以便用户可以将其放在他想要的任何地方?

如果有人使用过“flipkart”应用程序,您可以看到“ping”按钮。这就是我要找的东西。有人有什么想法吗?

提前致谢

最佳答案

是的,您可以在 iOS 中拖动 UIButtons 和 UIViews。以下是我在谷歌搜索“拖动 uibutton ios”时发现的一些解释方法的帖子:

Basic Drag and Drop in iOS

how to make UIbutton draggable within UIView?

Touch and drag a UIButton around, but don't trigger it when releasing the finger

如果你想在重新启动应用程序时保存它被用户拖动到的位置,那么使用 NSUserDefaults。

关于ios - 可以拖动到 View Controller 中任何位置的 float 按钮?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33431189/

相关文章:

ios - 在Objective-C中需要声明哪些场景关键字 “volatile”?

iphone - "Conforms to"在 Iphone 术语中代表什么?

iphone - hitTest 返回错误的 UIView

ios - 平台的子平台无效

ios - 我如何确定地触摸按钮?

ios - 如何检测用户的 iPhone 6 Plus 是标准模式还是缩放模式?

ios - 在 View Controller 之间传递数据

ios - 用户界面按钮 : How to set image and text using imageEdgeInsets and titleEdgeInsets?

javascript - 从 safari 调用 ios 安装的应用程序

iOS 如何为每个用户获取数据解析 Swift