Scroll bars not displaying for NSView placed inside a NSScrollView in MacOS application using XCode

156 Views Asked by At

I am running with an issue where the Label text which is placed inside NSView is getting cut off at bottom and right side of content view & even scroll bars are not getting displayed. I am using Xcode 11.3 in macOS Mojave 10.14.

I have dragged NSScrollView onto my view and set the following constraints to the NSScrollView

enter image description here

Now, i have dragged a Label to the content view of NSScrollView, added a huge text to the Label such that it crosses the NSScrollView horizontally as well as vertically and added the following constraints to it

enter image description here

The following screenshot shows the project structure that i have implemented for displaying horizontal and vertical scroll bars

enter image description here

After running the application i found that the scroll bars are not getting displayed and the text is getting cut off at the bottom and to the right of the content view. Please check the screenshot below regarding the output that is obtained .

enter image description here

Can you please suggest what needs to be done in order to display the scroll bars for viewing the text that is getting cut off?

0

There are 0 best solutions below