Saturday, November 21, 2026
HomeiOS Developmentios - The way to constrain top for ScrollView with dynamic content...

ios – The way to constrain top for ScrollView with dynamic content material inside?

[ad_1]

We are attempting to resolve the warning for ScrollView “wants constraint for y place or top”

The scrollView has

  • a card View which has dynamic content material inside, e.g. varied textual content that expands with accessibility
  • a tableview with undetermined variety of cells whose content material can even increase with accessibility

To date we are able to solely put >= top constraint for the tableView/cardView, however the scrollView would not know the precise top of its subcomponents so it will probably’t calculate itself.

Nonetheless, even with the warning, it does run fantastic and as anticipated.

An alternate technique we have tried is to place an express top on the the tableView, as an instance 500, then when the view has loaded, get the calculated content material measurement and set top = precise content material measurement.

Is there a greater solution to deal with top constraints for ScrollView with dynamic content material inside?

[ad_2]

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments