Learn how to simplify your iOS layouts in iOS 11 with this UIStackView tutorial.
This is a companion discussion topic for the original entry at https://www.raywenderlich.com/508-uistackview-tutorial-introducing-stack-views
Learn how to simplify your iOS layouts in iOS 11 with this UIStackView tutorial.
Some thing is really strange, seance when is the hidden property animatable?
Hi, I am just in the second part where you need to select the Rating label and the 5 star label. As soon as I select embed in Stack View, the width of both go to zero. I tried to do the remainder of that section and it ends up with the stack way at the top of the screen.
I am using Xcode 9 beta 4.
Thanks
Hi,
I have a general question concerning tutorials like this one.
Would it possible to create a PDF-file of these tutorials, so that you can download and also print them out?
Sometimes it much better if you could print out these tutorials, especially if you want to work with them.
I know itâs a question for Ray but perhaps other readers would appreciate this suggestion as well.
Thanks,
Peter
canât run this project. i got this error:
.../VacationSpots_Starter/VacationSpots/AppDelegate.swift:56:57: Type 'NSAttributedString' has no member 'foregroundColor'
Hi @vizel, this tutorial was written for Xcode 9, Swift 4 and the iOS 11 SDK and I think that youâre trying to open it in Xcode 8? You can download Xcode 9 from here: Sign In - Apple
Hey @rapier64, thanks for the suggestion!
Most of our books already cover (or will do in the future) these subjects in slightly other ways so spending extra time making PDF copies isnât usually worth the effort. Saying that though, you could always âprintâ the page and then save it out to a PDF yourself? Hope that helps
Hi @arkadi, this has been possible ever since UIStackView
was introduced in iOS 9 however it only applies to views that have been embedded as an arranged subview of a stack view.
This is because internally a 0pt height constraint is applied to the subview when hiding and this is something that has always been animatable. You can read more about this in the Dynamically Changing the Stack Viewâs Content section of the UIStackView
docs
I have exactly the same problem.
Hi,
Iâm get same problem, using Xcode 9 beta 4, on the starter project.
The compiler fix suggestion says
Cannot convert value of type âStringâ to expected dictionary key type âNSAttributedStringKeyâ
Replace âNSAttributedStringKey.foregroundColor.rawValueâ with âNSAttributedStringKey(rawValue: NSAttributedStringKey.foregroundColor.rawValue)â
After applying fix, the project runs.
Have a nice day !
I set the âPreferred widthâ of both the Rating label and 5 star label to 100 (in the Size Inspector), and the problem is gone. It works, but I have no idea why it works
Hello,
Yes, I had the same result as @nilocski using Xcode 9 beta 4. And the Xcode recommended fix should get you going. Click the Fix button:
Weâll update the starter project, so this wonât be a problem for much longer.
Cheers,
Kevin Colligan
Hi @pegasusroe @jeffkempster: Iâm seeing the same thing since updating to Xcode 9 beta 4 (this worked fine in beta 3.)
It appears to be a bug. For some reason, the when adding the top constraint for the Rating stack view, Xcode adds it to the base View rather than the label just above it. You can see that by clicking the little down arrow by the top constraint:
Like @pegasusroe discovered, you can get around this by adding a width to the stack view. Step-by-step, you would (1) select the stack view, (2) click on the Pin button, (3) add a Width of 200 (or whatever) and click âAdd 1 Constraintâ, (4) click on the Pin button again and continue with the tutorial â make sure the top constraint you add is 20 from the whatToSee label:
Cheers,
Kevin
Same Here, I used the preferred width as mention and it worked. But wondering why
I am not getting the squished âSubmit Ratingâ in my iPhone SE simulator with iOS 11/10.3. It looks ok.
Using XCode 9 GM release
I found out that problem about stacking RATING and â â â â â .
If you change the Lines property from 0 to 1 in the â â â â â label, then the stack view can be created without problem.
This tutorial is more than six months old so questions are no longer supported at the moment for it. We will update it as soon as possible. Thank you! :]