Implementing a gauge control with UIKit on the iPhone

前端 未结 1 997
予麋鹿
予麋鹿 2021-01-17 04:13

For an application I\'m working on, I\'d like to implement sort of a gauge-like control. The gauge should be of vertical orientation and I\'d like to get the effect of a dia

相关标签:
1条回答
  • 2021-01-17 04:25

    Look into the UIScrollView class.

    From what I read in your question, this should give you what you need.

    The scroll view acts as a kind of 'window' on top of a content view. The content view is clipped by the scroll view if it is larger.

    So you could have a content view is that is say, for arguments sake, 50x320, and the scroll view be only 50 x 50. The area of the content view will be clipped to the 50x50 size, and you will be able to move the content view by scrolling with your finger, like other native iPhone controls.

    Many, if not all, iPhone apps use a scroll view in some way. UITableViews are subclasses of scroll views, as are UITextViews.

    Apple has a decent example app that shows how to use a scroll view, so check that out too.

    0 讨论(0)
提交回复
热议问题