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

Problem with navigation controller #3

Open
zeeshankhan opened this issue Mar 13, 2013 · 2 comments
Open

Problem with navigation controller #3

zeeshankhan opened this issue Mar 13, 2013 · 2 comments

Comments

@zeeshankhan
Copy link

Hi,

While adding tile view controller into a navigation controller with navigation bar visible, tile frame gets misplaced by 44 pixels. It also affects tapping on a tile.

I have tried with placing a seperate UIView on top of view controller's view and then adding all the tiles into that view, but still it misplaces.

I am not understanding the behaviour, please help.

Many Thanks.

@kristopherjohnson
Copy link
Owner

I haven't tried putting TilesViewController into a navigation controller (or anything else).

I don't know what's going on and haven't tried debugging this, but I have noticed that -[TilesViewController createTiles] doesn't take into account the bounds of the enclosing view when calculating frames for the tiles. If the enclosing view's origin is not (0, 0), then it won't be putting them in the right place. You might try offsetting each tileFrame by the enclosing view's origin.x and origin.y.

@zeeshankhan
Copy link
Author

Thanks for the reply.

Only change I did in the project to add a navigation stack in App Delegate file:

UINavigationController *navCont = [[UINavigationController alloc] initWithRootViewController:viewController];
[window setRootViewController:navCont];
// [window addSubview:viewController.view];
[window makeKeyAndVisible];

I have tried multiple option along with setting offset through CGRectOffset to fix the issue but it didn't work for me.

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