2
UIScrollView를 UIViewController에 스토리 보드에 넣었습니다.내 UIScrollView가 ios6의 자동 레이아웃과 작동하지 않습니다.
- (void)viewDidLoad
{
[super viewDidLoad];
[_scrollview setContentSize:CGSizeMake(_scrollview.bounds.size.width*2, _scrollview.bounds.size.height)];
[_scrollview setPagingEnabled:YES];
CGRect rect = _scrollview.bounds;
UIView* view = [[UIView alloc]initWithFrame:rect];
[view setBackgroundColor:[UIColor redColor]];
[_scrollview addSubview:view];
rect = CGRectOffset(rect, _scrollview.bounds.size.width, 0);
view = [[UIView alloc]initWithFrame:rect];
view.backgroundColor = [UIColor greenColor];
[_scrollview addSubview:view];
}
그건 자동 레이아웃없이 잘 작동하지만, "RECT"값을 사용하도록 설정하면 자동 레이아웃에 해당하는 코드는 무엇 0에 해당한다 :이 코드를 사용하는 경우?