You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Build and run the example project, tap the first row on the table view. You can see that the titleView is not shown.
Now tap the "Next" bar item on the opened view controller, and then tap the "Back" arrow, now you can see that the titleView is shown.
I found this bug on my iPhone 6 Plus which installed iOS 8.4, I also tested in iPhone Simulator 9.0/9.1/9.2 and it worked fine.
After debugging, I found that the titleView was removed from popupController's navigationBar after presenting popupController. This is so strange. Maybe it is an iOS bug.
Temporary Fix:
Re-add titleView to navigationBar when viewDidAppear, or reset navigationItem.titleView:
- (void)viewDidAppear:(BOOL)animated
{
[superviewDidAppear:animated];
// BugFix: navigationBar's titleView is not shown after presenting STPopupController.// See: https://github.com/kevin0571/STPopup/issues/60if (self.popupController) {
UIView *titleView = self.popupController.navigationBar.topItem.titleView;
if (titleView && !titleView.superview) {
// Re-add titleView to the navigationBar// [self.popupController.navigationBar addSubview:titleView];// Or: invoke -[STPopupController updateNavigationBarAniamted]
self.navigationItem.titleView = titleView;
}
}
}
The text was updated successfully, but these errors were encountered:
Reproduce:
In
PopupViewController1.m
, settitleView
inviewDidLoad
Build and run the example project, tap the first row on the table view. You can see that the titleView is not shown.
Now tap the "Next" bar item on the opened view controller, and then tap the "Back" arrow, now you can see that the titleView is shown.
I found this bug on my iPhone 6 Plus which installed iOS 8.4, I also tested in iPhone Simulator 9.0/9.1/9.2 and it worked fine.
After debugging, I found that the titleView was removed from popupController's navigationBar after presenting popupController. This is so strange. Maybe it is an iOS bug.
Temporary Fix:
Re-add titleView to navigationBar when
viewDidAppear
, or resetnavigationItem.titleView
:The text was updated successfully, but these errors were encountered: