如何为 iPhone/iPad 应用程序创建浮动工具栏?
我正在为 iPad/iPhone 开发一个位图编辑器应用程序,我希望有一个浮动工具栏,用户可以在绘图画布上移动它,这样它就不会妨碍绘图表面。我会使用标准 UIToolbar,但我希望工具栏具有缩放导航视图,这不太适合标准 UIToolbar。
- 在较高的层次上,我如何构建一个浮动工具栏?
- 是否有用于创建浮动工具栏的标准 iPhone UI 控件?
- 我在 UI 指南中没有看到任何内容,但是这种自定义控件是否会受到应用商店的欢迎?
预先非常感谢您的帮助!
I'm working on a bitmap editor app for the iPad/iPhone and I'd like to have a floating toolbar that the user can move around the drawing canvas so it doesn't get in the way of the drawing surface. I'd use a standard UIToolbar, but I'd like the toolbar to have a zoom navigation view, which wouldn't fit elegantly in a standard UIToolbar.
- At a high level, how could I build a floating toolbar?
- Is there a standard iPhone UI control for creating a floating toolbar?
- I didn't see anything in the UI Guidelines, but is this kind of custom control frowned upon by the App store?
Thanks so much in advance for your help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
SDK 中没有浮动工具栏,但您当然可以制作自己的浮动工具栏。
创建一个新的 UIView 子类并在其中绘制工具栏(或者使用现有的 UIToolBar,如果它可以满足您的需要,但作为自定义视图的子视图)。
然后将触摸事件捕获到自定义视图中,以便用户可以通过用手指拖动浮动工具栏来移动它。
许多最好的 iPhone 和 iPad 应用程序都有自定义控件,因此这当然不会令人不悦。
There is no floating toolbar in the SDK but you can certainly make your own.
Make a new subclass of UIView and draw your toolbar there (or use the existing UIToolBar if it does what you need but as a subview of your custom view).
Then capture the touch events into your custom view so the user can move the floating toolbar by dragging it with his finger.
Many of the best iPhone and iPad apps have custom controls so this is certainly not frowned upon.