swift - Xcode expects UILabel in stack view to have greater height than it is -


i trying place 2 identically sized sets of uilabel directly above uitextfield on uiview. figured excellent use of stack views.

here screenshot of elements

however, reason, xcode seems expect uilabel taller should , results in warnings layout.

here warnings

with uilabel selected, can see outline. can see same sized outline on other uilabel too, , when selecting stack view elements shows larger area. when clicking on uitextfield, outline shown begin outline uilabel ends. using 'resolve auto layout issues' 'update frames' make stack view expand outwards match size of outline, instantly jumps original size.

gold highlight around area larger should be

am misusing or have misconfigured stack views? or there other issue going on?

i using xcode 7.3 build 7d111g.

this because label filling stackview.

don't give height constraint stackview. add following 2 constraints top stackview

  1. top space
  2. center horizontally in container

enter image description here

stackview height content.

check updated gif :

enter image description here

all warning finished.

hope can help.


Comments

Popular posts from this blog

authentication - Mongodb revoke acccess to connect test database -

r - Update two sets of radiobuttons reactively - shiny -

ios - Realm over CoreData should I use NSFetchedResultController or a Dictionary? -