1、iPad上Present imagePicker失效的问题
dispatch_async(dispatch_get_main_queue(), ^ {
[self presentViewController:imagePickerController animated:YES completion:nil];
});
作者:YoRuo_
链接:https://www.jianshu.com/p/92ce67684941
來源:简书
2、self.navigationController.hidesBarsOnSwipe = YES
// 由于设置self.navigationController.hidesBarsOnSwipe = YES;之后,在滑动隐藏navigationBar之后返回时会有内存泄漏,所以使用UIScrollViewDelegate的方法,来进行navigationBar的隐藏与展示。
- (void)scrollViewDidScroll:(UIScrollView*)scrollView {
CGFloaty Velocity = [scrollView.panGestureRecognizer velocityInView:scrollView].y;
if (yVelocity > 0 && !self.statusBarAnimationInProgress) {
[self setNavigationBarHidden:NO];
} else if (yVelocity <0&& !self.statusBarAnimationInProgress) {
[self setNavigationBarHidden:YES];
}
}
- (void)setNavigationBarHidden:(BOOL)hidden {
[CATransaction begin];
self.statusBarAnimationInProgress = YES;
[CATransaction setCompletionBlock:^{
self.statusBarAnimationInProgress = NO;
}];
[self.navigationController setNavigationBarHidden:hidden animated:YES];
[CATransaction commit];
}
网友评论