Thanks for the replies. I'll try and get to Le Madeleine next Tuesday, although Tuesday's tend to be problematic for me.
-- @Jose, thanks for the link to the stuff from John Williams. I'll take a look at it today. I hear you about Xcode 4 vs 5. After trying with Xcode 4 I swore I would never have anything to do with Auto Layout. Then I read lots of blog posts about how everything was so much better in 5. I even (successfully) tried building a couple of simple things and thought, "aha! they're right" Then for the last few months I've been working on projects with pretty trivial layout.
Jon August suggested I give more details. So here are details galore. Feel free to skip and do something more interesting with your lives. Like root canal.
- Although the layout I'm trying to achieve is pretty simple, I haven't tried the springs and struts approach because I need to support iOS 6 and 7, and I read in a couple of places that suggest I want to tie things to the top and bottom layout guides.
- The overall context for the app is a UITabBarController
- The layout for this particular view has two subviews: a web view and a custom view, which I'll refer to as a widget view. Both of these subviews should stretch across the whole screen
- The widget view should be 50 pixels high and should hug the tab bar. The existing version of the app was built many moons ago (and several versions of both Xcode and the SDK ago), so when I went and built it against the newest SDK I find that the widget view is disappearing under the tab bar.
- The web view should fill up the remaining vertical space. Ideally, I'd like to move it down from under the status bar. But that can come later.
- My approach is as follows:
1. Set the following constraints on the widget view: height 50, 0 px vertical spacing between it and the bottom layout guide, 0 px horizontal leading spacing between it and its superview, 0 px horizontal trailing spacing between it and its superview.
At this point, Xcode usually is complaining that the constraints on the widget view are ambiguous. Usually something along the lines of need to specify the y position. Probably not surprising, but the specific warnings vary depending on what order I specify the constraints. I have deleted all the constraints and tried rebuilding using several different approaches.
2. Set the following constraints on the web view: same width as widget view, 0 px vertical spacing between it and the widget view, 0 px vertical spacing between it and the top layout guide (although very often Xcode resets this as something like -290 px between the top layer guide and the _bottom_ of my web view (as best I can tell)
3. At this point, I look at the warnings and errors Xcode is displaying and try tweaking and adjusting. Eventually, my blood pressure shoots through the roof and I step away from the keyboard for a while.
Anyway, thanks again everyone!
Matt
You received this message because you are subscribed to the Google Groups "NSCoderNightDC" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nscodernightdc+unsubscribe@googlegroups.com.
To post to this group, send email to nscodernightdc@googlegroups.com.
Visit this group at http://groups.google.com/group/nscodernightdc.
For more options, visit https://groups.google.com/groups/opt_out.
0 comments:
Post a Comment