iPhone iOS how to create interactive drag, rotate, resize, delete view control?

我们两清 提交于 2019-12-13 12:17:51

问题


I got an app that allows users to add content to a canvas. I would like to be able to offer the user an ability to move, rotate, resize, reflect this content. Currently I'm doing this with gestures, but would like to know if there is some sort of open-source widget that draws a box around the view and adds 4 buttons to do these functions:

  • rotate 90 degrees
  • rotate freely
  • resize
  • delete

Can anyone think of an open source framework that I can add to my project to create controls like the ones displayed?

I can probably build this by hand, but debugging gesture recognizers and view rotation is not the most fun thing, so I'm looking for something more polished.

Thank you!


回答1:


Here's a link to an open source control on cocoa controls that looks like something you could use: TDResizerView.

"TDResizerView is used to resize and rotate an imageview with single finger"

Sounds like a good place to start from, even if you need to modify it. I've never used this particular control though, so take my word for what it's worth.

edit: Also keep in mind that on iOS, users generally expect gestures. Forcing them to use the handles instead of pinching or rotating may be bad for your user experience, depending on why you want the handles instead.



来源:https://stackoverflow.com/questions/15417820/iphone-ios-how-to-create-interactive-drag-rotate-resize-delete-view-control

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!