On Mar 20, 2016, at 7:57 AM, Roland King <r...@rols.org> wrote:
> 
> I have a UIStackView, vertical, set to ‘fill equally’ with a number of 
> UILabels in it. The stackview in this instance happens to be 300pts high. If 
> I put 1 UILabel in it, the UILabel is 300pts high. This is what I would 
> expect. 
> 
> If I put two in it, the stackview sets them both 160pts high (total 320), 
> three, they’re 113pts high (total 330) , four, 90pts high (total 360). None 
> of those add up to 300 so the labels are not properly spaced out and don’t 
> line up correctly with other groups of views which are next to them.

What are you using to measure the label heights?  Are you looking at the frame 
or the alignment rect (i.e. applying -alignmentRectForFrame: to the frame)?  
Anything using auto layout, such as UIStackView, will use the alignment rect.  
The alignment rect may very well be inset from the frame so that if you (or 
UIStackView) makes two labels abut according to their alignment rects, their 
frames may actually overlap.

Also, have you set the stack view's baselineRelativeArrangement or spacing 
properties?

Regards,
Ken


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to