如果判断NSScrollView滚动到了最后

转自:http://www.codexsoftware.co.uk/blog/computers/programming/how-to-determine-if-an-nstextview-is-scrolled-to-the-end/


bool scrollToEnd = YES ;
 
id scrollView = ( NSScrollView *)textView.superview.superview;
if ([scrollView isKindOfClass:[ NSScrollView class ]]) {
     if ([scrollView hasVerticalScroller]) {
         if (textView.frame.size.height > [scrollView frame].size.height) {
             if (1.0f != [scrollView verticalScroller].floatValue)
                 scrollToEnd = NO ;
         }
     }
}

你可能感兴趣的:(如果判断NSScrollView滚动到了最后)