【发布时间】:2012-07-09 08:47:14
【问题描述】:
在完成与 UINavigationController 项目相关的问题后,我来发布我的确切问题..
首先我没有在MainWindow.xib 中添加 UINavigationController 我创建并在AppDelegate 文件中添加 UINavigationController
之后在UIViewController(不在rootViewController)类中,我必须添加一个Done类型的右栏按钮我是
将其添加到 searchbarDelegate 方法中,显示为粗体:-
- (void) searchBarTextDidBeginEditing:(UISearchBar *)theSearchBar {
//This method is called again when the user clicks back from teh detail view.
//So the overlay is displayed on the results, which is something we do not want to happen.
if(exhibDataObj.searching)
return;
//Add the overlay view.
if(ovController == nil)
ovController = [[OverlayViewController alloc] initWithNibName:@"OverlayView" bundle:[NSBundle mainBundle]];
CGFloat yaxis = self.navigationController.navigationBar.frame.size.height;
CGFloat width = self.view.frame.size.width;
CGFloat height = self.view.frame.size.height;
//Parameters x = origion on x-axis, y = origon on y-axis.
CGRect frame = CGRectMake(0, yaxis, width, height);
ovController.view.frame = frame;
ovController.view.backgroundColor = [UIColor grayColor];
ovController.view.alpha = 0.5;
ovController.rvController = self;
[self.theTableView insertSubview:ovController.view aboveSubview:self.parentViewController.view];
exhibDataObj.searching = true;
letUserSelectRow = NO;
self.theTableView.scrollEnabled = NO;
//Add the done button.
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]
initWithBarButtonSystemItem:UIBarButtonSystemItemDone
target:self action:@selector(doneSearching_Clicked:)];
}
但这永远行不通。
任何帮助都会更有意义。
【问题讨论】:
-
您尝试在哪个 iOS 版本中运行应用程序?
-
您是否在
Appdelegate和UIViewController中都添加了您的UINavigationBar? -
@Jasmine 查看问题的标签!!!
-
@nfarshchi 我在 appDelegate 文件中添加 UINavigationController 并在所有应用程序中访问它......
标签: objective-c xcode4.3 ios5