作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个名为 SplashViewController 的 UIViewController 实例。我将它添加到 AppDelegate 的主窗口中,如下所示:
splashViewController = [[SplashViewController alloc]initWithNibName:@"SplashScreen" bundle:[NSBundle mainBundle]];
splashViewController.view.frame = [UIScreen mainScreen].bounds;
[self.window setBackgroundColor:[UIColor blackColor]];
self.window.frame=[UIScreen mainScreen].bounds;
window.rootViewController = splashViewController;
[window makeKeyAndVisible];
[self.view setUserInteractionEnabled:NO]; // YES also have no effect
最佳答案
尝试设置:
self.view.userInteractionEnabled = YES;
viewWillAppear:
”方法中。
splashViewController
”保存为应用程序委托(delegate)中的实例变量?您在 AppDelegate 的 .h 或 .m 文件中的何处声明“
SplashViewController * splashViewController;
”?如果它没有在您的应用程序委托(delegate)中设置为 ivar,则它可能会在您添加后立即发布。
关于IOS setUserInteractionEnabled 不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18679885/
我有一个名为 SplashViewController 的 UIViewController 实例。我将它添加到 AppDelegate 的主窗口中,如下所示: splashViewControlle
我想使 UIButton 禁用用户触摸。 setEnabled 和setUserInteractionEnabled 都可以做到这一点。哪个更好?它们有何不同? 最佳答案 enabled 是 UICo
我是 iOS 新手,我对 setUserInteractionEnabled 有疑问: 我有一个从 UIImageView 扩展的对象,例如: @interface CustomImageView :
等等!!!: 我知道您可能认为这个问题已经被问过并回答过好几次了。但我可以保证你这个问题是独一无二的。 问题: 在 iOS 应用程序中,想象一下有两个按钮,如下图所示,它们有两个 Action ,就像
我是一名优秀的程序员,十分优秀!