简体   繁体   English

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

[英]How can I create a floating toolbar for an iPhone/iPad app?

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. 我正在为iPad / iPhone开发一个位图编辑器应用程序,我希望有一个浮动工具栏,用户可以在绘图画布上移动,这样就不会妨碍绘图表面。 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. 我使用标准的UIToolbar,但我希望工具栏有一个缩放导航视图,它不适合标准的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? 是否有用于创建浮动工具栏的标准iPhone UI控件?
  3. I didn't see anything in the UI Guidelines, but is this kind of custom control frowned upon by the App store? 我没有在UI准则中看到任何内容,但这种自定义控件是否受App Store的影响?

Thanks so much in advance for your help! 非常感谢您的帮助!

There is no floating toolbar in the SDK but you can certainly make your own. SDK中没有浮动工具栏,但您当然可以创建自己的工具栏。

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). 创建UIView的新子类并在那里绘制工具栏(或者如果它执行您需要的操作,则使用现有的UIToolBar,但作为自定义视图的子视图)。

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. 许多最好的iPhone和iPad应用程序都有自定义控件,所以这当然不会令人不悦。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在iPhone Web应用程序中创建页脚/工具栏? - How can I create a footer/toolbar in an iPhone web app? 我如何加入iPad和iPhone应用程序? - How can i join an iPad and iPhone app? 如何以编程方式确定我的应用程序是iPad还是iPhone - How can I programmatically determine if my app iPad or iPhone 如何将iPhone / iPad应用程序与iBooks上的电子书捆绑在一起? - How can I bundle an iPhone/iPad app with an ebook on iBooks? iOS 5:如何使用UIPickerView创建UIAlertView? (iPhone / iPad) - iOS 5: How can I create a UIAlertView with a UIPickerView? (iPhone / iPad) 如何从现有的 iPhone 代码库发布 iPad 应用程序? - How can I publish an iPad app from an existing iPhone codebase? 如何以编程方式确定我的应用程序正在iPhone,iPad或iPhone 4上运行? - How can I determine programmatically that my app is running on an iPhone, iPad or iPhone 4? 如何在iPhone / iPad中解除pushViewController? - How can I dismiss a pushViewController in iPhone/iPad? 如何创建与 iPhone/iPad App 交互的 Mac/PC 服务器应用程序? - How to create a Mac/PC server app that interacts with iPhone/iPad App? 如何在ipad应用程序中添加iphone界面,以便在应用程序启动时选择正确的界面? - How can i add an iphone interface to a ipad app so that the proper interface is selected when the app is started?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM