Views compressed by other views in SwiftUI VStack and List

You might prevent the views in VStack from being compressed by using

  .fixedSize(horizontal: false, vertical: true)

For example:
I have the following VStack:

VStack(alignment: .leading){
        ForEach(group.items) {
            FeedCell(item: $0)
        }
    }

Which render compressed Text()

VStack with compressed elements

When I add .fixedSize(horizontal: false, vertical: true)
it doesn’t compress anymore

VStack(alignment: .leading){
        ForEach(group.items) {
            FeedCell(item: $0)
                .fixedSize(horizontal: false, vertical: true)
        }
    }

VStack doesn't compresss content

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)