简体   繁体   English

iPhone应用程序中的iOS SDK自定义导航栏类​​型顶部栏

[英]iOS sdk custom navigation bar type top bar in iphone app

i'm woking on my first iphone app. 我正在使用我的第一个iPhone应用程序。 the app uses a tab bar template, the current iteration of the app doesn't use a navigation controller, but now i need someway of presenting an action sheet in one of the views to allow users to save images to the photos app or e-mail the same image and even more importantly for the app let them use air print to print the image they are viewing. 该应用程序使用标签栏模板,该应用程序的当前迭代未使用导航控制器,但现在我需要以某种方式在其中一个视图中显示一个操作表,以允许用户将图像保存到photos应用程序或e-邮寄同一张图片,更重要的是,对于该应用程序,允许他们使用空中打印来打印他们正在查看的图像。 for the look and feel to stay consistent i need something like a system navigation bar; 为了使外观保持一致,我需要诸如系统导航栏之类的东西; something that looks like one, that would allow me to place a button inside it so that then users could tap that to get the action sheet. 看起来像一个东西,可以让我在其中放置一个按钮,以便用户可以点击它以获取操作表。

what is the best way of doing that? 最好的方法是什么? would this top bar have to be like any other view in the hierarchy? 该顶部栏是否必须与层次结构中的其他任何视图相同? can i place any type of button inside any view? 我可以在任何视图中放置任何类型的按钮吗? a button icon like the system one that the action one? 一个像系统一样的按钮图标,那个动作一个? (in the human interface guidelines - system buttons/icons). (在人机界面指南中-系统按钮/图标)。 many apps implement this type of thing but like i said it's my first one. 许多应用程序都实现了这种类型的事情,但是就像我说的那样,这是我的第一个。

thanks in advance 提前致谢

Use a UIToolbar . 使用UIToolbar It looks and acts pretty similar to a UINavigationBar . 它的外观和行为与UINavigationBar相似。 You can place it anywhere as it is just a subclass of UIView . 您可以将它放在任何地方,因为它只是UIView的子类。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM