2012-12-16 24 views

Antwort

13

können Sie Benachrichtigung NSViewBoundsDidChangeNotification erhalten wie unten

NSView *contentView = [scrollview contentView]; 

[contentView setPostsBoundsChangedNotifications:YES]; 

// a register for those notifications on the content view. 
[[NSNotificationCenter defaultCenter] addObserver:self 
             selector:@selector(boundDidChange:) 
              name:NSViewBoundsDidChangeNotification 
              object:contentView]; 

gezeigt, um die Benachrichtigungsmethode

- (void)boundDidChange:(NSNotification *)notification { 
    // get the changed content view from the notification 
    NSClipView *changedContentView=[notification object]; 
} 
Verwandte Themen