iPhone OS: Tap status bar to scroll to top doesn't work after remove/add back

后端 未结 9 1018
执笔经年
执笔经年 2020-12-05 12:30

Using this method to hide the status bar:

[[UIApplication sharedApplication] setStatusBarHidden:YES animated:YES];

When setting \"hidden\"

9条回答
  •  有刺的猬
    2020-12-05 13:08

    I had a similar problem after playing a Youtube video within my app. scrollsToTop was still set to YES but tapping the status bar had no effect.

    I finally realised that my app window was no longer the key window. After adding the following line to a UIWindow subclass (which I already had for other reasons) everything worked as it should again:

    if (![self isKeyWindow]) [self makeKeyWindow];
    

提交回复
热议问题