Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

无法手势返回 #132

Closed
nullfy opened this issue Oct 17, 2017 · 12 comments
Closed

无法手势返回 #132

nullfy opened this issue Oct 17, 2017 · 12 comments

Comments

@nullfy
Copy link

nullfy commented Oct 17, 2017

Xcode 8.3.3 && Xcode 9.0
真机和模拟器都无法手势返回

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    self.window = [[UIWindow alloc] init];
    self.window.backgroundColor = [UIColor clearColor];
    [self.window makeKeyAndVisible];
    self.window.frame = [UIScreen mainScreen].bounds;
    
    UITabBarController *tab = [[UITabBarController alloc] init];
    tab.viewControllers = @[[[RTContainerNavigationController alloc] initWithRootViewController:[ViewController new]],
                            [[RTContainerNavigationController alloc] initWithRootViewController:[ViewController1 new]],
                            [[RTContainerNavigationController alloc] initWithRootViewController:[ViewController2 new]],
                            [[RTContainerNavigationController alloc] initWithRootViewController:[ViewController3 new]]];
    
    self.window.rootViewController = [[RTRootNavigationController alloc] initWithRootViewControllerNoWrapping:tab];
    return YES;
}

=============================

unexpected nil window in __dispatchPreprocessedEventFromEventQueue, _windowServerHitTestWindow: <UIClassicWindow: 0x100305940; frame = (0 0; 768 1024); userInteractionEnabled = NO; gestureRecognizers = <NSArray: 0x17005c830>; layer = <UIWindowLayer: 0x170026f20>>
@rickytan
Copy link
Owner

rickytan commented Oct 18, 2017

window 的 frame 为 0,改为:

self.window = [[UIWindow alloc] initWithFrame:[UIScreem mainScreem].bounds];

然后再 makeKeyAndVisible,试试

@nullfy
Copy link
Author

nullfy commented Oct 18, 2017

先设置frame效果一样 ,网易云音乐的i4.0.1 pa自签名到ipad mini上也是不能手势返回

@rickytan
Copy link
Owner

rickytan commented Oct 19, 2017

报的这个错误,应该是点击事件都没有分发,除了不能手势返回,点击、拖动还有效吗?

@nullfy
Copy link
Author

nullfy commented Oct 20, 2017

点击、滑动都是有效的
昨天在8.3.3 的模拟器上有时候可以响应返回,真机不行,和Xcode9.0.1(真机模拟器)都不行

@rickytan
Copy link
Owner

rickytan commented Oct 22, 2017

这个 能不能解决您的问题?

@rickytan
Copy link
Owner

或者 [self.window makeKeyAndVisible]; 放到最后 return YES 前再试试?

@nullfy
Copy link
Author

nullfy commented Oct 23, 2017

感谢您耐心的回复🙏

@rickytan
Copy link
Owner

已经好了?

@nullfy
Copy link
Author

nullfy commented Oct 23, 2017

没有呢

@nullfy
Copy link
Author

nullfy commented Oct 23, 2017

我是采用纯代码方式创建的,您可以建个demo调试一下

@rickytan
Copy link
Owner

我自己的项目全是代码的,没有问题

@nullfy
Copy link
Author

nullfy commented Oct 24, 2017

可否发个demo🙏
908427270

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants