在segue之后UIViewController没有显示背景

时间:2023-01-17 21:46:10

Storyboard:

故事板:

在segue之后UIViewController没有显示背景

Simulator before segue with view (which is connected to a tab bar controller) showing correct background:

在segue之前的模拟器与视图(连接到标签栏控制器)显示正确的背景:

在segue之后UIViewController没有显示背景

A tap on any of the icons causes a push segue but the background is white, when it should be blue: 在segue之后UIViewController没有显示背景

点击任何图标会导致推送segue但背景为白色,当它应为蓝色时:

I'm using AQGridview and the code for the segue is:

我正在使用AQGridview,而segue的代码是:

-(void)gridView:(AQGridView *)gridView didSelectItemAtIndex:(NSUInteger)index
{
    [self performSegueWithIdentifier:@"mySegue" sender:self];
}

Can anyone tell me what I'm missing?

谁能告诉我我错过了什么?

2 个解决方案

#1


1  

Did you set the seque Identifier?

你设置了seque标识符了吗?

在segue之后UIViewController没有显示背景

#2


0  

Turns out it was something rather stupid but I'll explain it because it's the type of thing I can imagine happening to anyone else who is as daft as me. (There has to be someone as daft as me...)

事实证明这是相当愚蠢的事情,但我会解释它,因为这是我能想象的事情发生在任何像我一样愚蠢的人身上。 (必须有人像我一样愚蠢......)

I'd earlier added a webView to to the viewDidLoad method of the destination ViewController. The default colour of the webView is white and it was overlaid on top of the background colour, so I couldn't see it.

我之前添加了一个webView到目标ViewController的viewDidLoad方法。 webView的默认颜色是白色,它覆盖在背景颜色的顶部,所以我看不到它。

Removed the code referring to the webView and all was well again.

删除了引用webView的代码,一切都很好。

Yes, I'm feeling rather foolish now.

是的,我现在感觉很愚蠢。

#1


1  

Did you set the seque Identifier?

你设置了seque标识符了吗?

在segue之后UIViewController没有显示背景

#2


0  

Turns out it was something rather stupid but I'll explain it because it's the type of thing I can imagine happening to anyone else who is as daft as me. (There has to be someone as daft as me...)

事实证明这是相当愚蠢的事情,但我会解释它,因为这是我能想象的事情发生在任何像我一样愚蠢的人身上。 (必须有人像我一样愚蠢......)

I'd earlier added a webView to to the viewDidLoad method of the destination ViewController. The default colour of the webView is white and it was overlaid on top of the background colour, so I couldn't see it.

我之前添加了一个webView到目标ViewController的viewDidLoad方法。 webView的默认颜色是白色,它覆盖在背景颜色的顶部,所以我看不到它。

Removed the code referring to the webView and all was well again.

删除了引用webView的代码,一切都很好。

Yes, I'm feeling rather foolish now.

是的,我现在感觉很愚蠢。