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

Sizing View Controllers #6

Open
davidtperk opened this issue May 14, 2015 · 6 comments
Open

Sizing View Controllers #6

davidtperk opened this issue May 14, 2015 · 6 comments

Comments

@davidtperk
Copy link

Hey Brendan, thanks for the repo. Your code works perfectly with .xibs, but when I try to substitute view controllers for .xibs, the sizes are all thrown off. The only code I changed was:

This:
var AVc :AViewController = AViewController(nibName: "AViewController", bundle: nil); var BVc :BViewController = BViewController(nibName: "BViewController", bundle: nil); var CVc :CViewController = CViewController(nibName: "CViewController", bundle: nil);

To this:
var AVc = storyboard!.instantiateViewControllerWithIdentifier("VC1") as! UIViewController var BVc = storyboard!.instantiateViewControllerWithIdentifier("VC2") as! UIViewController var CVc = storyboard!.instantiateViewControllerWithIdentifier("VC3") as! UIViewController

img_2706
img_2707
img_2708

@lbrendanl
Copy link
Owner

@dtp5 were you able to get the original code working correctly? I just grabbed a fresh copy of master, added 3 view controllers to the storyboard and placed in ne Storyboard IDs to each view controller and then used the same three lines that you had, and it worked correctly for me.

@davidtperk
Copy link
Author

Yeah I added view controllers to your project and it ran fine. Only in my project are the sizes distorted. I've tried everything. One thing I'm thinking about is that I have an iPhone 6, and your project doesn't have native resolution on my phone. My project has native resolution, but the sizes are all off. Could that be it?

I've even copy+pasted view controllers from your project into mine and had the same problems.

UPDATE: So I tried the view controller method from within your project, and it worked fine, although without native resolution. I built a brand new project, copy+pasted everything in the new project, and was faced with the same issues. So, what's different about your project?

@chanc-ee
Copy link

I've been having the same issue, try as I might, the Views won't go edge to edge (5 fine, 6 has a gap) but the original Repo does this fine - it's so strange!
I've been hunting for strange settings in the plist and all sorts.

@LuAndreCast
Copy link

@lbrendanl I did the same above and was having the same issue at first.
Resolve the issue by removing the "auto size classes" and by making sure that all my labels and items on the view controller had appropriate constraints.

@desduvauchelle
Copy link

I'm having the exact same issue as the initial post. Has a solution been found? It's driving me nuts. It's copy paste identical!

PS: Thanks for the awesome repo despite the issue :)

@sudeepag
Copy link

Was there any solution to this problem? I'm facing the same issue.

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

6 participants