Permalink
Browse files

NSView doesn't always support scrollToBeginningOfDocument:

  • Loading branch information...
1 parent 48f6397 commit 5625711ba081f632a7f88f87dadd0fa9a3e20f44 @alexzielenski committed Nov 15, 2011
Showing with 7 additions and 1 deletion.
  1. +7 −1 ScrollToRefresh/src/EQSTRScrollView.m
@@ -60,7 +60,6 @@ - (void)createHeaderView {
clipView.drawsBackground=NO;
self.contentView=clipView;
- [clipView.documentView scrollToBeginningOfDocument:self];
[self.contentView setPostsFrameChangedNotifications:YES];
[[NSNotificationCenter defaultCenter] addObserver:self
@@ -109,6 +108,13 @@ - (void)createHeaderView {
[self.contentView addSubview:refreshHeader];
[clipView release];
+
+// if ([self.contentView.documentView respondsToSelector:@selector(scrollToBeginningOfDocument:)])
+// [self.contentView.documentView scrollToBeginningOfDocument:self];
+
+ [self.contentView scrollToPoint:NSMakePoint(contentRect.origin.x, contentRect.origin.y+contentRect.size.height-self.contentView.documentVisibleRect.size.height)];
+ [self reflectScrolledClipView:self.contentView];
+
}
- (void)scrollWheel:(NSEvent *)event {
if (event.phase==NSEventPhaseEnded) {

0 comments on commit 5625711

Please sign in to comment.