【发布时间】:2010-07-15 21:47:46
【问题描述】:
我一直在尝试从three20 弹出一个TTPhotoViewController。起初它没有后退按钮,但我现在实现了它并尝试弹出视图但没有运气。这是我的代码的 sn-p:
按钮(有效)--
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;
}
它已经添加了一个后退按钮,但可惜这段代码也没有向我的导航栏添加一个按钮。
【问题讨论】:
标签: iphone three20 objective-c ttphotoviewcontroller