I need to add a variable number of NSSliders to a custom view at runtime and I would like to have them spaced evenly across the available space. I've looked at Apple docs and seen some examples on 'net and they none of them quite illustrate how to do this. I might have one view, I might have four. How can I programmatically express these constraints between an unknown number of items?

有帮助吗?

解决方案

I found the answer here: https://github.com/smileyborg/UIView-AutoLayout

Written for iOS, but easy enough to make work for MacOS

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top