为什么视图的框架自动改变了?
看到这个代码:
- (void)loadView{
UIScrollView *sv = [[UIScrollView alloc] initWithFrame:CGRectMake(-10,0,340,480)];
self.view = sv;
NSLog(@"sv frame = %@", NSStringFromCGRect(self.view))
}
- (void)viewWillAppear{
NSLog(@"view frame = %@", NSStringFromCGRect(self.view));
}
在我的演示输出中:sv frame = {{-10, 0}, {340, 480}}
视图框架 = {{0, 0}, {320, 480}}
应该是:view frame = {{-10, 0}, {340, 480}}
但在 PhotoScroller 演示(2010 WWDC 104)中,它是正确的。太奇怪了。