QGrid icon indicating copy to clipboard operation
QGrid copied to clipboard

Warning on macOS: Invalid frame dimension (negative or non-finite)

Open patrick-fu opened this issue 4 years ago • 2 comments

On macOS 11.1, when a View is loaded for the first time, the size obtained by GeometryReader is incorrect, resulting in a negative frame value, causing this warning. The real size can only be obtained the second time, as shown in the screenshot.

Screenshot2020-12-17 15 31 46

patrick-fu avatar Dec 17 '20 08:12 patrick-fu

Same on tvOS

keylook avatar Jan 30 '21 10:01 keylook

try this, it works for me ~

.frame(width:abs(self.contentWidthFor(geometry)))

shywoody avatar Dec 15 '21 16:12 shywoody