问题描述
我有一个应用程序 (Xamarin.IOS),它以没有 TabBar 的 UIViewController(连接视图)开头.但是当用户登录时,我想将我创建的标签栏添加到其他视图中.反之亦然,当用户注销时,我想显示没有 TabBar 的连接视图.
我知道当我想显示 TabBar 时,在 appDelegate 中,我必须像这样初始化 _window:
如果我想要一个没有 TabBar 的视图,这里是 appDelegate:
使用这个 TabController :
但是如何从带有 TabBar 的视图移动到不带 TabBar 的视图,反之亦然?
我不使用 StoryBoard,而是在 Xamarin.iOS 上编写代码.
制表符 -> 无制表符
推送时
在场时
无标签 -> 标签
先将Connection Page设置为RootViewController,然后根据需要修改.
代码:
并在Connection Page
中更改
I have an application (Xamarin.IOS) which start with a UIViewController (Connection view) with no TabBar. But when user Logged, I'd like to add the tabbar that I've created to other views. And vis-versa, when user logged out, I'd like to display the connection view without TabBar.
I know that when I want to display the TabBar, in appDelegate, I have to initialize _window like this :
and if I want to have a view without TabBar, here is appDelegate:
with this TabController :
But how can I move from a view with TabBar to a view without and vis-versa ?
I don't use StoryBoard and I code on Xamarin.iOS.
Tab -> No Tab
When Push
When Present
No Tab -> Tab
Set Connection Page as RootViewController at first, and then change it when you want to.
Code:
And change it in Connection Page
这篇关于一些 UIViewControllers 中的 XAMARIN.IOS UITabBarController的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!