美文网首页
用户点击状态栏问题

用户点击状态栏问题

作者: 春雨霏霏_____ | 来源:发表于2018-01-03 17:08 被阅读0次

#pragma mark - Status bar touch tracking

- (void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { [super touchesBegan:touches withEvent:event];

 CGPoint location = [[[event allTouches] anyObject] locationInView:[self window]];

 CGRect statusBarFrame = [UIApplication sharedApplication].statusBarFrame; 

 if (CGRectContainsPoint(statusBarFrame, location))

 {

         [self statusBarTouchedAction];

 }}

- (void)statusBarTouchedAction {

 [[NSNotificationCenter defaultCenter] postNotificationName:kStatusBarTappedNotification

                                                        object:nil];

}

禁用掉状态栏设置scrollview的属性

scrollsToTop = NO

相关文章

网友评论

      本文标题:用户点击状态栏问题

      本文链接:https://www.haomeiwen.com/subject/xoxknxtx.html