File tree Expand file tree Collapse file tree 4 files changed +22
-3
lines changed
Expand file tree Collapse file tree 4 files changed +22
-3
lines changed Original file line number Diff line number Diff line change @@ -86,6 +86,9 @@ If you have ideas how to improve this library please let me know or send a pull
8686Changes
8787-----
8888
89+ **0.9.6**
90+ * Fixed a Position bug when you hide the UINavigationBar with the UINavigationBar hidden property.
91+
8992**0.9.5**
9093* Fixed warnings
9194* Other little bugfixes
Original file line number Diff line number Diff line change @@ -165,4 +165,9 @@ typedef NS_ENUM(NSInteger,TSMessageNotificationDuration) {
165165 This depends on the Base SDK and the currently used device */
166166+ (BOOL )iOS7StyleEnabled ;
167167
168+ /* * Indicates whether the current navigationBar is hidden by isNavigationBarHidden
169+ on the UINavigationController or isHidden on the navigationBar of the current
170+ UINavigationController */
171+ + (BOOL )isNavigationBarInNavigationControllerHidden : (UINavigationController *)navController ;
172+
168173@end
Original file line number Diff line number Diff line change @@ -212,9 +212,9 @@ - (void)fadeInCurrentNotification
212212
213213 BOOL isViewIsUnderStatusBar = [[[currentNavigationController childViewControllers ] firstObject ] wantsFullScreenLayout ];
214214 if (!isViewIsUnderStatusBar && currentNavigationController.parentViewController == nil ) {
215- isViewIsUnderStatusBar = ![currentNavigationController isNavigationBarHidden ]; // strange but true
215+ isViewIsUnderStatusBar = ![TSMessage isNavigationBarInNavigationControllerHidden: currentNavigationController ]; // strange but true
216216 }
217- if (![currentNavigationController isNavigationBarHidden ])
217+ if (![TSMessage isNavigationBarInNavigationControllerHidden: currentNavigationController ])
218218 {
219219 [currentNavigationController.view insertSubview: currentView
220220 belowSubview: [currentNavigationController navigationBar ]];
@@ -303,6 +303,17 @@ - (void)fadeInCurrentNotification
303303 }
304304}
305305
306+ + (BOOL )isNavigationBarInNavigationControllerHidden : (UINavigationController *)navController
307+ {
308+ if ([navController isNavigationBarHidden ]) {
309+ return YES ;
310+ } else if ([[navController navigationBar ] isHidden ]) {
311+ return YES ;
312+ } else {
313+ return NO ;
314+ }
315+ }
316+
306317- (void )fadeOutNotification : (TSMessageView *)currentView
307318{
308319 currentView.messageIsFullyDisplayed = NO ;
Original file line number Diff line number Diff line change @@ -422,7 +422,7 @@ - (CGFloat)updateHeightOfMessageView
422422 if (!navigationController && [self .viewController isKindOfClass: [UINavigationController class ]]) {
423423 navigationController = (UINavigationController *)self.viewController ;
424424 }
425- BOOL isNavBarIsHidden = !navigationController || self.viewController .navigationController . navigationBarHidden ;
425+ BOOL isNavBarIsHidden = !navigationController || [TSMessage isNavigationBarInNavigationControllerHidden: self .viewController.navigationController] ;
426426 BOOL isNavBarIsOpaque = !self.viewController .navigationController .navigationBar .isTranslucent && self.viewController .navigationController .navigationBar .alpha == 1 ;
427427
428428 if (isNavBarIsHidden || isNavBarIsOpaque) {
You can’t perform that action at this time.
0 commit comments