简体   繁体   English

UIViewController上的UITabBar

[英]UITabBar over UIViewController

I have a UITabBarController with two UIViewController inside. 我有一个带有两个UIViewController的UITabBarController。 How to initilaiser UIViewController not to display a portion is below the UITabBar ? 如何初始化UIViewController不显示UITabBar以下的部分?

Edit: 编辑:

AppDelegate.m: AppDelegate.m:

ViewController *viewController = [[ViewController alloc] init];
self.tabController = [[UITabBarController alloc] init];
[self.tabController setViewControllers:@[viewController] animated:YES];
self.window.rootViewController = self.tabController;

ViewController.m: ViewController.m:

- (void)viewDidLoad {
    [super viewDidLoad];
    [self.view addSubview: [[MyGraphicView alloc] initWithFrame:[self.view bounds]]];
}

How to initilaiser UIViewController not to display a portion is below the UITabBar ? 如何初始化UIViewController不显示UITabBar以下的部分?

I think you're mistaking the gloss effect for translucency that's allowing the table to show through the tab bar. 我认为您会误以为是半透明的光泽效果,该效果使表格可以通过选项卡栏显示。 Here's an image showing two tabs: 这是显示两个标签的图像:

标签栏

It does look like the content view is showing through from under the tab bar, but it's not really showing through -- you're just seeing the glossy effect used to draw the tab items. 看起来确实像是从选项卡栏下面显示的内容视图,但是并没有真正显示出来-您只是看到了用于绘制选项卡项目的光泽效果。 To illustrate, I'll change the background color of the content to purple: 为了说明,我将内容的背景色更改为紫色:

紫色含量

If the content were really showing through the tab bar, you'd see purple showing instead of the white/gray that you can see is there. 如果内容确实通过选项卡栏显示,则您会看到紫色显示,而不是在那里看到的白色/灰色。 To see this in your own app, just scroll the table a bit. 要在自己的应用中看到此内容,只需稍微滚动一下表格即可。 If the table were really showing through the tab bar, you would be able to read the content of the next cell, including the "9" and the separator line. 如果该表确实通过选项卡栏显示,则您将能够读取下一个单元格的内容,包括“ 9”和分隔线。 I'm sure you won't see that, though. 不过,我敢肯定您不会看到。

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

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