视图隐藏了 tabbarcontroller
我开发了一个基于选项卡的 iPhone 应用程序。 在此,我面临如下所述的问题:
与第一个选项卡栏关联的视图包含 2-3 个按钮。这些按钮的作用是加载另一个视图。现在,按下这些按钮后,视图将以全尺寸(320x480)加载并隐藏选项卡栏。 我想在选项卡栏上方加载该视图,以便可以访问选项卡栏。 我在该视图的 viewDidLoad 函数中显式设置了视图框架,但它不起作用。
请帮帮我。
I have developed a tab based iphone application.
In this, I am facing a problem as described below:
The view associated with 1st tab bar contains 2-3 buttons. Action of these buttons are to load another view. Now on pressing these buttons the views are loading but in full size(320x480) and hiding the tab bar.
I want to load that view just above the tab bar so that tab bar is accessible.
I explicitly set the view frame in that view's viewDidLoad function, but it is not working.
Please help me out.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
试试这个:
您需要从基于视图的应用程序开始。然后在 appDelegate 文件中创建一个 UITabbarController 。
Appdelegate.h
您可以相应地管理要在哪个选项卡中放置导航控制器或仅放置视图控制器。
然后在上面提到的每个视图控制器中,您需要实现
可以设置选项卡名称和图像的功能。
根据您的要求重命名 tbs。将 2 个按钮放置在导航控制器的视图之一中。
希望这有帮助。
Try this :
You need to start with view based application. And then create a UITabbarController in you appDelegate file.
Appdelegate.h
You can accordingly manage in which tab you want to place navigation controller or only a view controller.
Then in each of the view controllers mentioned above you need to implement
in which you can set Tab name and image.
Rename the tbs as per your requirement. Place 2 buttons in the one of the views which is Navigation controller.
Hope this helps.
典型的应用程序导航允许用户在选项卡之间自由地前后移动。这是通过在导航栏堆栈上推送和弹出 ViewController 来实现的。
在某些情况下,您希望强制用户完成某些任务,此时您应该使用模态视图控制器。当应用程序呈现模态视图时,其想法是用户不应该能够导航离开视图,而应该只能完成或取消操作,因此模态视图的默认行为是隐藏导航 从你的描述
来看,你正在执行导航而不是模态任务,因此我可以建议使用pushViewController而不是presentModalViewController吗?
如果您仅使用presentModalViewController,因为您想要从下到上的动画,那么您将需要使用自定义动画。
Typical application navigation allows the user to freely move forwards and backwards, between tabs etc. This is facilitated by pushing and popping ViewController's on the navigation bar stack.
In certain scenarios you want to force the user to complete some task and this is when you should use a modal view controller. When the application presents a modal view the idea is that the user should NOT be able to navigate away from the view, instead they should only be able to complete or cancel the action and hence the default behavior for a modal view is to hide the navigation bar, tab bar etc.
It sounds to me from your description that you are performing navigation and not a modal task and thus can I recommend using pushViewController instead of presentModalViewController?
If you are only using presentModalViewController because you want a bottom to top animation then you'll need to use a custom animation.