iPhone/iPad circular intensity gauge control (image included)

让人想犯罪 __ 提交于 2019-12-21 02:34:14

问题


I found this interesting interface(starts at 33 seconds http://vimeo.com/22946428 ), and would like to design something similar for my own apps. I'm particularly interested in the circular intensity gauge/knob control as on the attached image. It has a very futuristic feel to it and should be fairly simple to implement using touchesMoved: gesture recognizer callback.

But in order to not-reinvent the wheel, are there any open source libraries that offer advanced UI capabilities, like the ones in the picture/video?

Update: Answer by Hubert demonstrates how to use single finger motion to rotate the dial. The second part of the puzzle is: how to fill the control with color?

I'm thinking of rotating a background color image, but a part of it has to be cut off or covered with something else to vary from an empty background to full. Maybe the cut out element (about 1 radian) may hide a set of fan-like segments that follow the finger and create an illusion of a continuously increasing or decreasing fill of the gauge. The 6 segments x,y would be continuously animating, positioning them in such a way as to cover only the required fraction of the control.


回答1:


I dont think you will find that control exactly, but Here are a couple of links to working with and tutorials on rotary controls for iOS:

http://www.raywenderlich.com/9864/how-to-create-a-rotating-wheel-control-with-uikit

http://maniacdev.com/2012/02/tutorial-creating-a-one-figure-rotation-gesture-recognizer-for-a-rotary-knob-control-on-ios/

http://maniacdev.com/2011/12/open-source-libraries-for-easily-adding-rotary-knob-controls-in-your-ios-apps/




回答2:


Check this gauge control: GaugeKit

It's very customisable, so you can adjust it, set not rounded ends and desired color - and it will looks very similar to gauge on your image!




回答3:


Here's an example of a circular progress view. Combined with a one finger rotary control, it creates a similar gauge to the one requested (simply overlay 2 controls on top of each other)

Then link the two controls with the rotation callback:

  - (void) rotation: (CGFloat) angle
{
    // calculate rotation angle
    imageAngle += angle;
    if (imageAngle > 360)
        imageAngle -= 360;
    else if (imageAngle < -360)
        imageAngle += 360;

 progress = imageAngle/360.0;
}

DACircularProgress view + OneFingerRotationGestrureRecognizer



来源:https://stackoverflow.com/questions/9621141/iphone-ipad-circular-intensity-gauge-control-image-included

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