Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed a problem when using -showTabBar: in iPad started in landscape mode #20

Merged
merged 5 commits into from
Aug 19, 2014

Conversation

TonnyXu
Copy link
Contributor

@TonnyXu TonnyXu commented Aug 18, 2014

Highly possibly it's a bug in UIKit that when you access the view from the TabBarController, you got a fixed view size discarded the orientation info.

@TonnyXu
Copy link
Contributor Author

TonnyXu commented Aug 18, 2014

This modification has a problem, please ignore it, I forgot that the self.navigationController might be nil. So, at least use the same logic as other method will be fine.

@TonnyXu TonnyXu closed this Aug 18, 2014
@TonnyXu TonnyXu reopened this Aug 18, 2014
@TonnyXu
Copy link
Contributor Author

TonnyXu commented Aug 18, 2014

Sorry, mis clicked the close this pull request button.

@TonnyXu
Copy link
Contributor Author

TonnyXu commented Aug 18, 2014

The new modification contains the logic based on the tabViewController only.

@@ -163,12 +175,12 @@ - (void)setTabBarOriginY:(CGFloat)y animated:(BOOL)animated
CGFloat toolBarHeight = frame.size.height;
CGSize viewSize = self.tabBarController.view.frame.size;
CGFloat viewHeight = UIInterfaceOrientationIsPortrait(self.interfaceOrientation) ? viewSize.height : viewSize.width;

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove white spaces.

@@ -138,7 +138,19 @@ - (void)setToolbarOriginY:(CGFloat)y animated:(BOOL)animated

- (void)showTabBar:(BOOL)animated
{
CGFloat viewHeight = self.tabBarController.view.frame.size.height;
/* NOTE by Tonny
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this comment is redundant because it's caused by my implementation miss and this tabBar behaviour is known.

@ninjinkun
Copy link
Owner

Thanks to your patch. Basically, it looks good. I added few comments.

@TonnyXu
Copy link
Contributor Author

TonnyXu commented Aug 19, 2014

Sorry, I just removed those dev notes and white spaces.

CGFloat topLimit = viewHeight - toolBarHeight;
CGFloat bottomLimit = viewHeight;

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove unnecessary white spaces (but leave new line 😃 )

@TonnyXu
Copy link
Contributor Author

TonnyXu commented Aug 19, 2014

👍 Good reviewer! :p Done.

@ninjinkun
Copy link
Owner

LGTM 👍

ninjinkun added a commit that referenced this pull request Aug 19, 2014
Fixed a problem when using `-showTabBar:` in iPad started in landscape mode
@ninjinkun ninjinkun merged commit bffbb97 into ninjinkun:master Aug 19, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants