diff --git a/RMGallery/RMGalleryViewController.m b/RMGallery/RMGalleryViewController.m index b1b8a52..e9791cf 100644 --- a/RMGallery/RMGalleryViewController.m +++ b/RMGallery/RMGalleryViewController.m @@ -72,9 +72,9 @@ - (void)viewDidLoad [self.view addGestureRecognizer:_tapGestureRecognizer]; } -- (void)viewWillAppear:(BOOL)animated +- (void)viewDidLayoutSubviews { - [super viewWillAppear:animated]; + [super viewDidLayoutSubviews]; if (!_initialGalleryIndexSet) { // In case the gallery index was set before the view was loaded