Force NSTextField (multiline wrapping label) to grow vertically?
Force NSTextField (multiline wrapping label) to grow vertically?
- Subject: Force NSTextField (multiline wrapping label) to grow vertically?
- From: Steve Mills <email@hidden>
- Date: Thu, 09 Apr 2015 11:24:18 -0500
I can't figure out a combination of constraints and hugging/compression values that will cause an NSTextField used as a multiline wrapping label to grow vertically when the window is resized horizontally. Here's basic layout of the views in the window. (If you aren't viewing plain text mail with a monospaced font, this'll be a mess. (And also; Why not?!?!;))
---------------------------------------
| ----------------------------------- |
| | multi- | |
| | line | |
| | label | |
| ----------------------------------- |
| |
| ----------------------------------- |
| | | |
| | NSTableView | |
| | | |
| ----------------------------------- |
| |
| (button) |
| |
| (button) (button) |
| |
---------------------------------------
The top and sides of the label are locked to the top and sides of the window, so it can grow horizontally. The top of the table is locked to the bottom of the label. The bottom and sides of the table are locked to the bottom and sides of the window, so it can grow vertically and horizontally. The buttons are locked to the bottom of the window.
If the window width gets small enough that the label needs to wrap, I'd like the label height to grow, which would shrink the height of the table (down to its minimum height). Is this possible?
I tried setting the label's vertical content hugging to 1 and the vertical content compression resistance to 1000, which seem like the right values to me. Does its intrinsic size never grow to fully contain the wrapped text?
--
Steve Mills
Drummer, Mac geek
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden