用户点击状态栏问题

2018-01-03  本文已影响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

上一篇 下一篇

猜你喜欢

热点阅读