this is my final window
i added 4 subviews (last 4 in 2nd image) to the base view. but not displaying the view. after manual resizing window the subviews appeared as below.
how can fix it?
baseView.needsDisplay = YES;
- 要么 -
subview.superview.needsDisplay = YES;
You can use NSScrollView:
NSScrollView* scrollView = [[NSScrollView alloc] init];
[scrollView setHasHorizontalScroller: YES];
[scrollView setHasVerticalScroller: YES];
self.contentView = [[NSView alloc] initWithFrame: NSMakeRect(0, 0, 1.0e7, 1.0e7)];
[self.contentView addSubview: [NSImageView ...]];
[self.contentView addSubview: [NSImageView ...]];
...
[scrollView setDocumentView: self.contentView];
self.view = scrollView;
Or use Minimum Size for Window.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.