SwiftUI .shadow 会阻止除第一个 List {} 之外的所有列表滚动手势。为什么?

SwiftUI .shadow blocks List scroll gesture for all but first List {}. Why?

如果我在 VStack 或 HStack 中放置 2 个或更多包含项目的列表并赋予 Vstack .shadow 属性,则只有第一个列表可滚动并接收“手势”事件。任何人都知道为什么以及这是预期的行为吗?对我来说似乎是个错误。在 Xcode 和设备 iOS 14 和 14.+

上试过
import SwiftUI

struct ContentView: View {
    var body: some View {
        VStack {
            ListView1()
            ListView2()
        }
        .shadow(radius: 5)
    }
}

struct ListView1:View {
    var values=["1","2","3"]
    var body: some View {
        List {
            ForEach(values, id: \.self) { (value) in
                Text("Value \(value)")
            }
        }
    }
}

struct ListView2:View {
    var values=["5","6","7"]
    var body: some View {
        List {
            ForEach(values, id: \.self) { (value) in
                Text("Value \(value)")
            }
        }
    }
}

使用compositingGroup()解决问题![​​=11=]


import SwiftUI

struct ContentView: View {
    var body: some View {
        VStack {
            ListView1()
            ListView2()
        }
        .compositingGroup()   //  <<: Here!
        .shadow(radius: 5)
    }
}