这是 UINavigationController 的 init 方法。我想我一定做错了。
- (id)init
{
self = [super init];
if (self) {
self.view.backgroundColor = [UIColor blackColor];
self.viewController = [[UIViewController alloc] init];
self.viewControllers = [NSArray arrayWithObject:self.viewController];
UIBarButtonItem *button = [[UIBarButtonItem alloc] initWithTitle:@"Done"
style:UIBarButtonItemStylePlain
target:self
action:@selector(done)];
self.viewController.navigationItem.rightBarButtonItem = button;
self.navigationBar.barStyle = UIBarStyleBlackTranslucent;
self.mediaScrollView = [[MediaScrollView alloc] initWithFrame:self.view.bounds];
self.mediaScrollView.touchDelegate = self;
self.mediaScrollView.fullScreenDelegate = self;
[self.viewController.view addSubview:self.mediaScrollView];
}
return self;
}
mediaScrollView 在我的导航栏前面。它应该出现在导航栏的后面。
这是调用它的方法:
self.mediaVC = [[PDMediaViewController alloc] init];
self.mediaVC.mediaScrollView.manualMedia = YES;
self.mediaVC.mediaScrollView.mediaDelegate = self;
self.mediaVC.mediaScrollView.currentMediaItem = 0;
self.mediaVC.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
[self presentModalViewController:self.mediaVC animated:YES];