three20 PhotoVC: editing rightBarButton

364 views Asked by At

I've created a subclassed TTPhotoViewController and presented modally in a navigation controller.

When I try to set the rightBarButtonItem, it won't change away from the "show all" button that would take me to the gallery.

I can set leftBarButtonItem but not right.

I tried created my own view controller which held the photo view controller, initialized it in VDL then set the frame and added subview, but I only saw white.

I want to use T20's functionality of auto-rotation, swipe to scroll, etc.. but I want to only show this detail view without the gallery, and let the user close it with a button on the nav bar.

Any suggestions?

2

There are 2 answers

0
Mike Morearty On BEST ANSWER

Looking at TTPhotoViewController.m, it appears that the "See All" button is created in a function called updateChrome; and it looks like there is no elegant way to override the creation of that button. So the best option I can think of, although this is somewhat clumsy, would be to just subclass TTPhotoViewController, and override that function. Either copy the code into your own function and tweak it (and don't call super), or call super but then assign a new button to rightBarButtonItem.

0
wangii On

it's too late but here is my two cents: subclass and override the didLoadModel

-(void)didLoadModel:(BOOL)firstTime;
{
    [super didLoadModel:firstTime];
    self.navigationItem.rightBarButtonItem = nil;
}