用户点击状态栏问题

#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

你可能感兴趣的:(用户点击状态栏问题)