代码部分:
UIWebView *wb = [[UIWebView alloc] init];
self.examplesView = wb;
[wb release];
examplesView.scalesPageToFit = YES;
[self.view addSubview:examplesView];
NSLog(@"createViewsForRect: %@, examplesView.frame : %@",NSStringFromCGRect(rect), NSStringFromCGRect(examplesView.frame));
输出:
createViewsForRect: {{0, 0}, {320, 480}},examplesView.frame : {{0, 0}, {0, 0}}
这个 UIViewController 稍后被添加到另一个控制器中,在那里调用了一个函数来加载一些东西,我做了一个日志:
examplesView.frame: {{0, 0}, {0, 360}}
因为宽度为 0,所以不可见。如何解决?为什么宽度为 0?
这是一个没有 ARC 的旧的继承代码......