Mi UIScrollView no funciona con diseño automático en ios6
He puesto un UIScrollView en mi UIViewController en mi guión gráfico. Cuando uso este código:
- (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];
}
Funciona bien sin diseño automático, pero cuando habilito, los valores "rect" son iguales a 0. ¿Cuál es el código equivalente con diseño automático?