简体   繁体   English

UIViewController具有灰色覆盖

[英]UIViewController has gray overlay

I'm experiencing a very odd problem. 我遇到一个非常奇怪的问题。 For some reason my UIViewController has a gray overlay. 由于某种原因,我的UIViewController具有灰色覆盖。 I am using 我在用

UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" 
bundle: nil];

ProjectDescriptionViewController *detailViewController =
[storyboard instantiateViewControllerWithIdentifier:@"DetailView"];

[self.navigationController pushViewController:
detailViewController animated:YES];

to push the view from a UIViewController in my Storyboard. 从我的Storyboard中的UIViewController推送视图。 It detects everything fine, and no errors are thrown, but for some reason the push towards this view is laggy and ends up having a gray overlay! 它可以很好地检测所有内容,并且不会引发任何错误,但是由于某种原因,向该视图的推动比较缓慢,最终会出现灰色叠加! I have went over my code and storyboard many, many times and even compared it to a past project with the same principle. 我已经多次检查了我的代码和情节提要,甚至将其与具有相同原理的过去的项目进行了比较。 If someone could point me in the right direction as to what might be my problem, that would be great thanks! 如果有人可以向我指出我可能遇到的问题的正确方向,那将非常感谢!

here is what I'm talking about here is a picture of my storyboard if that helps? 这就是我在说的这是我的情节提要的图片吗?

It looks like you have some design issues with your storyboard. 看来您的分镜脚本有一些设计问题。

Storyboards apps are embedded in either a UITabBarController or UINavigationController. 故事板应用程序嵌入在UITabBarController或UINavigationController中。

UITabBarControllers manage multiple UIViewControllers. UITabBarControllers管理多个UIViewControllers。 You are using a UITabBarController within the UINavigationController, and your UITabBarControllers are connected from there to multiple UINavigationControllers, so I can see why it is so confused. 您正在UINavigationController中使用UITabBarController,并且您的UITabBarControllers从那里连接到多个UINavigationController,所以我可以看到它为什么如此混乱。

I would recommend that you start with the base Tab Bar Controller instead of a navigation controller, then modally present your login screen (without animation) at the start, so that the login screen is "above" your Tab Bar Controller. 我建议您从基本的Tab Bar Controller而不是导航控制器开始,然后在开始时以模态显示登录屏幕(不带动画),以便登录屏幕位于Tab Bar Controller上方。 Then when they login, just dismiss the login screen. 然后,当他们登录时,只需关闭登录屏幕即可。

Then connect your UITabController to the separate UIViewControllers (NOT UINavigationControllers). 然后将您的UITabController连接到单独的UIViewControllers(不是UINavigationControllers)。

Here is a link to a tutorial that may help you with the UITabBarController embedding. 这里是教程的链接 ,可以帮助您进行UITabBarController嵌入。

Also, if you really want to stick with a UINavigationController, you can give it a toolbar, whose buttons you could connect to other view controllers. 另外,如果您真的想坚持使用UINavigationController,可以为其提供一个工具栏,该工具栏的按钮可以连接到其他视图控制器。 Just don't have UITabBarControllers and UINavigationControllers where you really want UIViewControllers. 只是没有真正需要UIViewControllers的UITabBarControllers和UINavigationControllers。

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

相关问题 在UINavigationBar和UIViewController上叠加UIView - Overlay a UIView on both a UINavigationBar and a UIViewController 显示自定义UIButton上的灰色叠加 - Gray Overlay on a custom UIButton getting displayed 如何在不同的UIViewController中使用自定义覆盖视图 - how to use customize overlay view in different UIViewController 如何以编程方式为触摸状态的UIButton创建灰色叠加层? - How to create a gray overlay for a UIButton in touched state programmatically? iPhone UIImage 从纹理具有灰色而不是 alpha - iPhone UIImage from texture has gray instead of alpha UIViewController - UIViewController 确定UIViewController已加载并具有有效视图的最佳方法是什么? - Best way to determine that a UIViewController has been loaded, and has a valid view? 如何使用非Google地图在iPhone应用程序中绘制自定义“标注气泡”(地名透明灰色叠加层)? - How do I draw custom “Callout Bubbles” (the place name transparent-gray overlay) in an iPhone application using non-google maps? 检测何时在其他必须包含UIViewController的UIView中添加UIView? - Detect when UIView is added in other UIView which MUST has a UIViewController? 我如何告诉我的UIView UIViewController中的按钮已被按下? (迅速) - How do i tell my UIView that the button in UIViewController has been pressed? (Swift)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM