私はしばらくの間アプリを構築しているので、これを尋ねるのはかなり恥ずかしいです。これまで、私は常にInterfaceBuilderを使用してビューなどを設定してきました。
これが私のloadViewです:
- (void)loadView {
UIView *splashView = [[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]];
splashView.backgroundColor = [UIColor clearColor];
UIImageView *splashImage = [[UIImageView alloc] initWithImage:[UIImage imageNamed:[[NSBundle mainBundle]pathForResource:@"splash" ofType:@"jpg"]]];
splashImage.frame = [splashView bounds];
[splashView addSubview:splashImage];
self.view = splashView;
}
何らかの理由で、imageViewが表示されません。エラーはありませんが、外観はありません。UIViewは追加されますが、UIImageViewは追加されません。
私が言ったように、私は伝統的にIBでこれを行ってきたので、プログラムによる方法にはあまり詳しくありません。
助けていただければ幸いです。