If I am programmatically creating an NSScrollView how do I go about flipping it? For example:
//set up the page rect
displayPageRect=NSMakeRect(400.0, 40.0,pageWidth, pageHeight);
displayPage = [[NSScrollView alloc] initWithFrame:displayPageRect];
How do I then over ride the default isFlipped setting from NO to YES?
Tried [displayPage isFlipped: YES]; and got a warning that displayPage didn't recognize the method and then the app failed on run.
You can subclass NSView to take flipped view.
@interface FlippedView : NSView {
}
@end
@implementation FlippedView
- (BOOL) isFlipped
{
return YES;
}
@end
Than set your flipped view as documentView of NSScrollView.
NSScrollView *scrollView = [[NSScrollView alloc] initWithFrame:frame];
FlippedView *flippedView = [[FlippedView alloc] initWithFrame:frame];
[scrollView setDocumentView: flippedView];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With