1
votes

I have a custom UIView that I want to put into UIScrollView. I use this code:

-(void)viewDidLayoutSubviews{
    myView = [[[NSBundle mainBundle]loadNibNamed:@"Case1" owner:self options:nil]objectAtIndex:0];
    [_scrollView setContentSize:CGSizeMake(myView.bounds.size.width , myView.bounds.size.height)];
    [_scrollView addSubview:myView];
}

I have a crash:

"Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Auto Layout still required after sending -viewDidLayoutSubviews to the view controller. INFillingHelpViewController's implementation needs to send -layoutSubviews to the view to invoke auto layout.'"

Can you help me ?

1
Uncheck auto layout in Case1.xib - LE SANG
works great thank you - Anthony

1 Answers

0
votes

Why to did like this.Try these line of code.If you need any help just ask.

UIView *view=[UIView alloc]initWithNibName:@"view" bundle:nil];
[_scrollView setContentSize:CGSizeMake(myView.frame.size.width , myView.frame.size.height)];
[_scrollView addSubview:view];