我一直试图从three20 中弹出一个TTPhotoViewController。起初它没有后退按钮,但我现在已经实现了它并试图弹出视图但没有运气。这是我的代码片段:
按钮(这有效) -
self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:TTLocalizedString(@"Back", @"Back to Albums") style:UIBarButtonItemStyleBordered target:self action:@selector(popView)];
-popView(方法被调用,但语句不起作用)--
- (void) popView {
[self.navigationController popViewControllerAnimated:NO];
}
谢谢
更新 0 -
这是 ttphotoviewcontroller 在其 init 中的代码(我检查了程序是否正在运行它)-
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) {
self.navigationItem.backBarButtonItem =
[[[UIBarButtonItem alloc]
initWithTitle:
TTLocalizedString(@"Photo",
@"Title for back button that returns to photo browser")
style: UIBarButtonItemStylePlain
target: nil
action: nil] autorelease];
self.statusBarStyle = UIStatusBarStyleBlackTranslucent;
self.navigationBarStyle = UIBarStyleBlackTranslucent;
self.navigationBarTintColor = nil;
self.wantsFullScreenLayout = YES;
self.hidesBottomBarWhenPushed = YES;
self.defaultImage = TTIMAGE(@"bundle://Three20.bundle/images/photoDefault.png");
}
return self;
}
它已经添加了一个后退按钮,但可惜这段代码也没有在我的导航栏中添加一个按钮。