「スーパービュー」として NSSplitView があります。この SplitView には、NSTableView を含むカスタム ビューがあります。Controller クラスからカスタム ビューを読み込んでから、カスタム ビューとテーブルのサイズを調整しようとしています。ただし、テーブルやカスタム ビューのサイズは変更されません。私が間違っているのは何ですか?
カスタム ビューのサイズを読み込んで設定するコントローラー クラス メソッドを次に示し
ます。@property (強い) AppsNavigationViewController *navigationViewController;
// Implementation
- (void) initNavigationView :(id)viewControllerClass :(NSString*) viewNibName {
_navigationViewController = [[viewControllerClass alloc]
initWithNibName:viewNibName bundle:nil];
// add the current custom view to the parent view
[_navigationView addSubview:[_navigationViewController view]];
[[_navigationViewController view] setAutoresizingMask:
NSViewHeightSizable|NSViewWidthSizable];
// set the bounds of the custom view to the size of the parent view
[[_navigationViewController view] setBounds:[_navigationView bounds]];
[_navigationViewController setDelegate:self]; // not relevant
[_splitView adjustSubviews]; // checked. contains the _navigationView
}
そして、これがどのように見えるかです:
編集 いくつかのビューをサブクラス化し、さまざまな背景を描画します。そして、サイズを取得しないのは間違いなくカスタムビューです!