swiftmacos-sierranstouchbar

How to add a scrollview in Touch Bar in Storyboard?


I am adding a few buttons to the Touch Bar in storyboard, everything works fine except that I can only fit about 4 buttons in there (since the buttons contain both image and text) in my education app.

I would like to add a scrollview to contains all the buttons, but does not seem to be able to drag a ScrollView into the Touch Bar. What is the best way to have a scrollable set of buttons in Touch Bar?

Touch Bar in Storyboard


Solution

  • You firstly need to insert Touch Bar View which can then contian NSScrollView.

    It should look like this:

    enter image description here

    Then the final output looks like this: enter image description here