0
我有一個navigationitem和一個導航欄。導航項具有標題(和按鈕)和導航欄(導航項下方)具有分段控制。切換NavigationItem標題與分段控制
如何在按下分段控件的一側時調整導航項的標題(objective-c)?
下面是從.m文件
if (segmentController.selectedSegmentIndex == 0) {
UIWebView *webview6=[[UIWebView alloc]initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];
NSString *[email protected]"http://apple.com";
NSURL *nsurl6=[NSURL URLWithString:url6];
NSURLRequest *nsrequest6=[NSURLRequest requestWithURL:nsurl6];
[webview6 loadRequest:nsrequest6];
webview6.scrollView.bounces = NO;
[self.view addSubview:webview6];
[self.view bringSubviewToFront: navbar2];
}
if (segmentController.selectedSegmentIndex == 1) {
UIWebView *webview7=[[UIWebView alloc]initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];
NSString *[email protected]"http://yahoo.com";
NSURL *nsurl7=[NSURL URLWithString:url7];
NSURLRequest *nsrequest7=[NSURLRequest requestWithURL:nsurl7];
[webview7 loadRequest:nsrequest7];
webview7.scrollView.bounces = NO;
[self.view addSubview:webview7];
[self.view bringSubviewToFront: navbar2];
}
代碼這裏是什麼樣子 -
你應該寫這個解決方案,而不是一個問題。 – rmaddy
不,但請在評論的答案和問題中寫一個解決方案 –