0

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?

Kamal
  • 453
  • 1
  • 10
  • 22
  • What happens if you set the width constraint to 1000? – Willeke Aug 21 '20 at 07:09
  • Even after setting the width constraint to 1000, there is no change in the output that is getting displayed – Kamal Aug 21 '20 at 07:30
  • Remove the trailing and bottom space constraints. – Willeke Aug 21 '20 at 07:50
  • Removed the trailing and bottom space constraints too as suggested but still there is no display of scroll bars to view the text that is getting cut off horizontally and vertically – Kamal Aug 21 '20 at 10:51
  • The document view of the scroll view must be wider and/or higher than the clip view. See [How Scroll Views Work](https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/NSScrollViewGuide/Articles/Basics.html#//apple_ref/doc/uid/TP40003461-SW1). – Willeke Aug 21 '20 at 14:02

0 Answers0