3

I want a photo viewer in my iphone app and I liked the Three20 photo viewer. I found it somehow hard to integrate it in my own app where I have my typical UINavigationViewController. So far I succeeded in doing the following:

TTURLMap *map = [[[TTURLMap alloc] init] autorelease];
[map from:@"tt://appPhotos" toSharedViewController:[PhotoViewController class]];  
[self.navigationController pushViewController:[map objectForURL:@"tt://appPhotos"] animated:YES];

The only problem is that wenn I click back to my original view, its navigation bar keeps the style of the photo viewer (transperant and shows the view under it). How can I get back my original navigation bar?

asnanak
  • 103
  • 6

2 Answers2

2

My experience: I once used three20's PhotoViewer and every time I went back from the PhotoViewer to my other view. The system status bar remained black and transparent (while it should be with default style). I solved it by manually and programmatically changing the status bar style every time when the back action was triggered.

Di Wu
  • 6,436
  • 3
  • 35
  • 51
1

Yes, this is a bit of an issue for sure. A good solution, as @diwup says, is to implement a manual fix. I tend to subclass TTPhotoViewer when I need it. Not only does it help with this problem but it also makes it much easier to use I find.

If you decide to subclass, then you should use whatever variation of the following you require:

- (void)viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:animated];
self.navigationController.navigationBar.barStyle = UIBarStyleBlack;
self.navigationController.navigationBar.tintColor = myTintColor;
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleDefault];
}

However, if you don't want to subclass, you can always put the code into the - [viewWillAppear:] method of any class that comes after the photo viewer.

imnk
  • 4,342
  • 3
  • 29
  • 31