0

好吧,这就是我正在尝试做的,但到目前为止还没有成功。

这就是我尝试过的:

- (void)awakeFromNib
{
    [[_myScrollView contentView] scrollToPoint:NSMakePoint(0,[[_myScrollView contentView] bounds].size.height)];
}

有任何想法吗?

4

2 回答 2

0

怎么样:

[[_myScrollView contentView] scrollToPoint:NSMakePoint(0,0)];
于 2013-08-12T17:32:19.983 回答
0

尝试这个

NSPoint newScrollOrigin = NSMakePoint(0.0,NSMaxY([[_myScrollView documentView] frame])
                          -NSHeight([[_myScrollView contentView] bounds]));

[[_myScrollView documentView] scrollPoint:newScrollOrigin];

要了解更多信息,请参阅此链接 -

https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/NSScrollViewGuide/Articles/Scrolling.html

于 2014-11-25T05:02:32.580 回答