如何在应用程序的正面和顶部设置自定义UIToolBar? [英] How to set a custom UIToolBar always in the front and top of the application?

查看:107
本文介绍了如何在应用程序的正面和顶部设置自定义UIToolBar?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经坚持了一段时间了。我试图将自定义工具栏放在我的iPad应用程序的前面(在其他视图的前面),但我不知道如何告诉UIApplicationDelegate将其建立为父视图。

I've been stuck with this for a while now. Im trying to put a custom toolbar always in the front of my iPad application (in the front of other views), however im not sure how to tell the UIApplicationDelegate to establish it as the parent view.

我尝试使用导航控制器,但我需要它始终位于顶部,我无法在更改视图时摆脱过渡动画。

I tried using a navigation controller but i need it stuck always in the top and i couldn't get rid of the transition animation when changing views.

任何帮助将不胜感激。谢谢!

Any help will be appreciated. Thanks!

推荐答案

您必须在主窗口中设置该自定义工具栏,或者以编程方式将该工具栏添加为窗口中的子视图,$
例如,如果工具栏的高度为50px,那么所有子视图的X位置必须以50px开头。

You have to set that custom toolbar in main window or add that toolbar programmatically as a subview in your window, and after that in all your child view controller set view size, For example if your toolbar has height of 50px that the X position of your all child view must be start with 50px.

这种方法对我有用,
希望它也能帮到你。

This approach is works for me, Hope it will help you also.

这篇关于如何在应用程序的正面和顶部设置自定义UIToolBar?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆