Apple OS X Developer API : NSScrollView class is the central coordinator for the Application Kit’s scrolling machinery
Questions tagged [nsscrollview]
548 questions
11
votes
2 answers
Setting NSScrollView Contents to Top Left Instead of Bottom Left When Document Swapping
I had one of my colleagues come to me today with a problem of how can he load or view-swap a documentView of an NSScrollView so that the loaded view appears to fix to the top-left corner instead of the bottom-let corner.
He had spent a while…

Hooligancat
- 3,588
- 1
- 37
- 55
11
votes
6 answers
NSScrollView jumping to bottom on scroll
I have an NSScrollView containing an NSImageView, which resizes based on various factors. When it resizes I have generally changed the image, so I scroll the NSScrollView to the top. This works fine. However, when I start to scroll the NSScrollView…

Nick Locking
- 2,147
- 2
- 26
- 42
11
votes
3 answers
How can I disable horizontal scrolling for an NSScrollView?
I first tried disabled the scroll bar by setting:
scrollView!.hasHorizontalScroller = false
and that successfully worked, but I could still scroll from left to right by using my trackpad.
Is there a way to ensure that horizontal scrolling is…

ra1nmaster
- 662
- 1
- 8
- 21
11
votes
2 answers
Programmatically set up NSTextView inside NSScrollView
I'm trying to set up an NSTextView in an NSScrollView programmatically and am having trouble.
Specifically, I can't scroll the text view; the scroll view seems to think "this is all there is". When you try to scroll down to see the rest of the…

Kalle
- 13,186
- 7
- 61
- 76
11
votes
5 answers
Disable scrolling in NSTableView
Is there a simple way to disable scrolling of an NSTableView.
It seems there isn't any property on
[myTableView enclosingScrollView] or [[myTableView enclosingScrollView] contentView] to disable it.

erkanyildiz
- 13,044
- 6
- 50
- 73
10
votes
1 answer
Drawing an NSTableView's background outside of its bounds
I'm having a problem since Lion introduced elastic scrolling (pictured below). When you scroll my table view (cell-based, with alternating row colors) beyond its bounds, the background doesn't draw. I've tried doing my own drawing in…

Dov
- 15,530
- 13
- 76
- 177
10
votes
2 answers
Overlay NSView over NSScrollView
I have an NSScrollView that fills an entire window and displays a huge image. Now I would like to overlay a custom NSView over parts of the Scroll View (eg. top 20 Pixels height and window width) to display additional information. As the user…

Robin
- 8,197
- 11
- 45
- 74
10
votes
7 answers
Displaying text in a NSScrollView (Swift)
Just started to learn Swift and created a little macOS app in which I want to use a NSScrollView to display an attributed String. I’ve tried:
@IBOutlet var ScrollViewOutlet : NSScrollView
var attributedString = NSMutableAttributedString(string:…

ixany
- 5,433
- 9
- 41
- 65
9
votes
5 answers
How to pass scroll events to parent NSScrollView
I need fixed-size NSTextViews inside a larger scrolling window. IB requires that the textviews be inside their own NSScrollViews, even though their min/max sizes are fixed so that they won’t actually scroll. When trackpad gestures are made within…

Wienke
- 3,723
- 27
- 40
9
votes
6 answers
Enabling NSScrollView to scroll its contents using Auto Layout in Interface Builder
I have implemented a custom NSView which contains many NSTextFields and other NSViews. I then embedded that custom view in a scroll view using Editor > Embed In > Scroll View. This creates the appropriate hierarchy as visible in the Outline, but I…

Jordan H
- 52,571
- 37
- 201
- 351
9
votes
3 answers
NSScrollView doesn't draw document view?
I have created a custom view that implements initWithFrame and drawRect. In IB, I created a window and placed the custom view in the center of the window. I then used Editor>Embed In>Scroll View to place the custom view into a scroll view. And then,…

user1574591
- 129
- 1
- 5
9
votes
2 answers
Center an NSView within an NSScrollView
How do I center an NSView within an NSScrollView like the way "Preview" does?

rhombus
- 145
- 1
- 6
9
votes
4 answers
NSScrollView scrollToTop
Does anyone know the correct way to scroll the NSScrollView to the top? I was looking for an equivalent to the UIView's scrollToTop method.
This is what I have so far, but its not quite right under all situations
[self.contentView…

user961889
- 351
- 2
- 12
9
votes
3 answers
Resize NSTableView or NSScrollView depending on number of rows in table
I have a view-based NSTableView which is embedded in an NSScrollView. It has custom cells that are x number of pixels high. The NSScrollView is the same size as the panel that it is a subview of. I want to resize the entire NSTableView depending on…

rick
- 1,075
- 4
- 20
- 29
8
votes
1 answer
Scroll To Refresh on Lion
Is it possible to get the "pull-to-refresh" scrollview, present in many applications on iOS, on Lion? I have been able to get my view in the "bounce area" of the scroll view and detect when to refresh. My problem is keeping the view scrolled up…

Alex Zielenski
- 3,591
- 1
- 26
- 44