【发布时间】:2011-03-22 15:43:59
【问题描述】:
大家好 我有一个基于标签栏的应用程序。在一个视图中,我有一个带有不同 TTTabItems 的 TTTabStrip。除了加载 UIWebViews 之外,一切正常(加载正常的 UIViewControllers)。
在应用委托中我设置了 url 映射:
TTNavigator* navigator = [TTNavigator navigator];
navigator.supportsShakeToReload = YES;
navigator.persistenceMode = TTNavigatorPersistenceModeAll;
TTURLMap* map = navigator.URLMap;
[map from:@"*" toViewController:[TTWebController class]]; // default klasse wenn nichts anderes gewählt ist.
[map from:@"tt://test" toViewController:[TestController class]];
测试控制器包含一个 UIWebView。我可以看到 (NSLog) 调用了 loadView-Method,但是 URL 没有被打开:
- (void) loadView {
CGRect applicationFrame = [UIScreen mainScreen].applicationFrame;
self.view = [[[UIView alloc] initWithFrame:applicationFrame] autorelease];
//self.view.backgroundColor = [UIColor blackColor];
NSURL *theURL = [NSURL URLWithString:@"http://www.google.com"];
[webView loadRequest:[NSURLRequest requestWithURL:theURL]];
// support zooming
webView.scalesPageToFit = YES;
}
例如,我可以将 UIWebView 的背景更改为黑色。
如何在 TTTabStrip 下方的网络视图中加载 google?
非常感谢。
【问题讨论】:
标签: iphone objective-c uiwebview three20