Note that there are some explanatory texts on larger screens.

plurals
  1. POAdding scrollView to another scrollView not working
    primarykey
    data
    text
    <p>I have a view which I set in interface builder, I added a scrollView in IB and now I'm trying to add another scrollView which will be only part of the parent scrollView. onside the child scroll view I'm trying to use a dynamic sized label which will reside under anothe fixed label.</p> <pre><code>UIScrollView *ingredientsScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(20, 287, 280, 300)]; ingredientsScrollView.scrollEnabled = YES; UILabel *ingredientsLabel = [[UILabel alloc] initWithFrame:CGRectMake(230, 310, 70, 21)]; ingredientsLabel.text = @"מצרכים"; UILabel *baseLabel = [[UILabel alloc] initWithFrame:CGRectMake(230, 325, 70, 21)]; baseLabel.text = @"חומרים לבסיס"; UILabel *baseIngredientsLabel = [[UILabel alloc] init]; CGSize maximumLabelSize = CGSizeMake(296,9999); CGSize expectedLabelSize = [baseIngredientsString sizeWithFont:baseIngredientsLabel.font constrainedToSize:maximumLabelSize lineBreakMode:baseIngredientsLabel.lineBreakMode]; //adjust the label the new height. CGRect newFrame = baseIngredientsLabel.frame; newFrame.size.height = expectedLabelSize.height; baseIngredientsLabel.frame = newFrame; //i added text to the string in some way baseIngredientsLabel.text = baseIngredientsString; [ingredientsScrollView addSubview:ingredientsLabel]; [ingredientsScrollView addSubview:baseIngredientsLabel]; [scrollView addSubview:ingredientsScrollView]; </code></pre> <p>When I run the app the child scrollView is not added nor the labels?</p> <p>Any help will be appreciated.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload