如何在 iPhone 中创建可拖动对象或控件?
我正在开发一个 iPhone 应用程序,其中一些值已写在 UILable 或 UIButton 上。我想问一下如何将这些控件拖到另一个位置。
请为我提供一些 iPhone 的示例。
是否可以将这些控件拖到 UITableView 中,然后保存 UITableView 值?
提前致谢。
I was developing a iPhone application in which some value has been written down on UILable or UIButton. I want to ask that how can i drag these control to another location.
Please provide me some example of iPhone for this.
Can it is possible to drag these control into UITableView and then save UITableView values ??
Thanks in Advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你可以从逻辑上做到这一点。
认为您在视图中的特定坐标处有一个表格视图。并且您有一个带有一些文本的标签,那么您可以使用触摸委托方法移动该标签。
及使用
为您的逻辑,在这里您可以将该标签文本保存在您显示表格内容的数据源数组中并使用 [YourTabl reloadData];并完成该标签的存在。
我认为这是有道理的。
You can do this logically.
Think you have an table view at particular co-ordinates in view. and you have a label with some text then you can move that label by using Touch Delegate methods.
and the use
for you logic,here you can save that label text in your data source array from where you display the table content and use [YourTabl reloadData]; and Finish that label presence.
I think it makes sense.
是的,您可以拖动任何 UIView。 中更改视图中心即可
只需在
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
Yes you can drag any UIView. Just change the center of your view in
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event