如何为 iPhone/iPad 应用程序创建浮动工具栏?

发布于 2024-09-06 12:48:59 字数 280 浏览 0 评论 0原文

我正在为 iPad/iPhone 开发一个位图编辑器应用程序,我希望有一个浮动工具栏,用户可以在绘图画布上移动它,这样它就不会妨碍绘图表面。我会使用标准 UIToolbar,但我希望工具栏具有缩放导航视图,这不太适合标准 UIToolbar。

  1. 在较高的层次上,我如何构建一个浮动工具栏?
  2. 是否有用于创建浮动工具栏的标准 iPhone UI 控件?
  3. 我在 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.

  1. At a high level, how could I build a floating toolbar?
  2. Is there a standard iPhone UI control for creating a floating toolbar?
  3. 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

圈圈圆圆圈圈 2024-09-13 12:48:59

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文