-1

I'm studying "scrollable stack view". I find that the sample code from Apple can directly drag and use the "scrollable stack view" control in window view.

The sample code link: https://developer.apple.com/documentation/appkit/views_and_controls/organize_your_user_interface_with_a_stack_view?language=objc

Then I try to code an imitation of the "scrollable stack view", but I don't find the "scrollable stack view" in Xcode 12.

So my question is Where the "scrollable stack view" in xcode?

See the following screenshot:

  • There isn't any "scrollable stack view" control in the sample code. – matt Jul 20 '21 at 03:30
  • hello, the "scrollable stack view" in "Main.storyboard". "scrollview->clipview->stackview". I have screenshot, https://developer.apple.com/forums/content/attachment/d6d74c1d-999b-412f-98dc-5feb6bd318d9 Apple's sample code, how to do it? It is very strange. – I Love 404 Jul 20 '21 at 04:21
  • You do exactly what you have shown in the screen shot: a stack view inside a scroll view. It isn't a scrollable stack view. It's the scroll view that is scrollable. – matt Jul 20 '21 at 04:40
  • OK, but I mean and want to know: how to add "stack view" into "scrollview" by xcode' control list, not by coding. for example: scrollview->clipview->stackview. – I Love 404 Jul 20 '21 at 07:56

1 Answers1

1

Follow Apple's instructions

You embed a stack view inside an NSScrollView object, making the stack’s content scrollable when the user resizes the window.

  1. Add a stack view
  2. Choose menu Editor -> Embed In -> Scroll View
Willeke
  • 14,578
  • 4
  • 19
  • 47