I would like to determine the size of the stack object before displaying it on the screen. The idea is to use it as part of a pull menu at the bottom of the screen, but when I request an object before it appears, it has a size (-1, -1). Is there anything I should do first of all before addressing the size of incremental content?
UIStackView does not have its own content. You get -1 because that is the value of UIViewNoIntrinsicMetric .
UIStackView
UIViewNoIntrinsicMetric
Instead, ask his fit size:
let size = stackView.systemLayoutSizeFittingSize(UILayoutFittingCompressedSize)
Source: https://habr.com/ru/post/1246362/More articles:Docker Maven Spotify Plugin - Ability to switch to an unprotected registry - mavenError starting emulator on Android - androidAn example of each group after a group panda - pythonC ++ 14 How often should constexpr be used? - c ++Swift ios facebook connects to application if user cancels login - iosR ginv and Matlab pinv give different results - rHow to make ngInfiniteScroll get data on createdAt Descending - angularjsOverride IBOutlet properties from superclass? - iosIs it possible to fade between two background images? - iosSoundCloud API - play count less than actual score - pythonAll Articles