Three20 不在 UIWebView 中显示网站
大家好 我有一个基于选项卡栏的应用程序。在一个视图中,我有一个带有不同 TTTabItems 的 TTTabStrip。除了加载 UIWebView 之外,一切正常(加载正常的 UIViewController)。
在应用程序委托中,我设置了 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?
多谢。
Hi all
I have a tabbar based application. In one view I have a TTTabStrip with different TTTabItems. Everything works (loading normal UIViewControllers) except loading UIWebViews.
In the app delegate I have set up the url mapping:
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]];
The test controller contains one UIWebView. I can see (NSLog) that the loadView-Method gets called, but the URL is not being opened:
- (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;
}
For instance, I can change the background of the UIWebView to black.
How can I load google in the web view below the TTTabStrip?
Thanks a lot.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试以下操作并添加方法 viewWillAppear:
Try the following and add the method viewWillAppear: