three20 PhotoVC: editing rightBarButton
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?
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
.
它已经太晚了,但这是我的两分钱:子类并重写didLoadModel
-(void)didLoadModel:(BOOL)firstTime;
{
[super didLoadModel:firstTime];
self.navigationItem.rightBarButtonItem = nil;
}
链接地址: http://www.djcxy.com/p/54962.html