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

Display issues when used within a UITabBarController #39

Closed
tranqy opened this issue Sep 25, 2012 · 6 comments
Closed

Display issues when used within a UITabBarController #39

tranqy opened this issue Sep 25, 2012 · 6 comments

Comments

@tranqy
Copy link

tranqy commented Sep 25, 2012

When displayed within a UITabBarController there is about 20 pixels that are blank below the UITableViewController used for the search results.

If you change the didFinishLaunchingWithOptions in the sample project to the code below you reproduce this.

I'm going to continue troubleshooting tonight/tomorrow and will submit a patch if I can find the issue. What I've found so far is the frame passed to initWithFrame is the same size regardless to the tabbar so inside the component there must be some calculation that is getting thrown off. The behavior is the same regardless of the hidesBottomBarWhenPushed BOOL.

Thanks for the awesome component!

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {    

    window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];

    TokenFieldExampleViewController * viewController = [[TokenFieldExampleViewController alloc] init];
    UINavigationController * navigationController = [[UINavigationController alloc] initWithRootViewController:viewController];
    UITabBarController *tabBarController = [[UITabBarController alloc] init];
    [tabBarController addChildViewController:navigationController];
    [viewController release];

    [window setRootViewController:tabBarController];
//    [window setRootViewController:navigationController]
    [navigationController release];

    [window makeKeyAndVisible];

    return YES;
}
@thermogl
Copy link
Owner

This works fine for me:

UITabBarController * tabBarController = [[UITabBarController alloc] init];
[tabBarController setViewControllers:@[navigationController]];
[window setRootViewController:tabBarController];

@tranqy
Copy link
Author

tranqy commented Sep 26, 2012

That's very odd. I changed how I add controllers to the UITabBarViewController to match what you showed above and I still have the same results. Here's a screenshot. I have TITokenField in my own project and saw the same thing so it's not something project specific. I tried in the 5.1, 6.0, and 6.0 "tall" simulators and they all behave the same.

I'll continue troubleshooting to see what I can find.

http://www.evernote.com/shard/s1/sh/e1b33808-17ca-4d02-916a-a15cfd6736e8/2de5b1ac143a80c1a3f21ea453c8d134

@thermogl
Copy link
Owner

Oh, I think it's a problem in the resizeViews method in the example view controller. It doesn't take into account a UITabBarController when determining its view's new height.

@tranqy
Copy link
Author

tranqy commented Sep 26, 2012

Excellent.. I'll focus my efforts in there. Thanks!

@tranqy
Copy link
Author

tranqy commented Sep 26, 2012

That's exactly it. I'll wrap this up in a patch and push it. Thanks for your help!

@tranqy
Copy link
Author

tranqy commented Sep 26, 2012

Submitted pull request. Sorry, didn't realize it would create a separate issue. This was my first pull request ;)

Thanks again for the great component and the help!

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

No branches or pull requests

2 participants