Xcode 11 beta 4 - relativeWidth is deprecated

后端 未结 1 630
遇见更好的自我
遇见更好的自我 2021-01-25 10:56

I have a VStack nested inside of an HStack that I want to take up 35% of the safe area width. So far through beta 3 I\'ve been able to do the by:

1条回答
  •  攒了一身酷
    2021-01-25 11:24

    Yes, it is deprecated. The release notes say:

    The relativeWidth(:), relativeHeight(:), and relativeSize(width:height:) modifiers are deprecated. Use other modifiers like frame(minWidth:idealWidth:maxWidth:minHeight:idealHeight:maxHeight:alignment:) instead. (51494692).

    Your only alternative seems to be GeometryReader :-(

    0 讨论(0)
提交回复
热议问题