'表达类型是模棱两可的,没有更多上下文

时间:2019-12-04 19:16:06

标签: swift swiftui

我在Swift文件中编码时遇到了这个奇怪的问题。一旦我插入“ .animation”,它就给了我这个错误。有人能帮助我解决这个问题吗?

Button(action: {
    self.showDetail.toggle()
}) {
    Image(systemName: "chevron.right.circle")
        .imageScale(.large)
        .rotationEffect(.degrees(showDetail ? 90 : 0)) // <- Type of expression is ambifuous without more context
        .padding()
        .animation(.easeInOut())
}

enter image description here

1 个答案:

答案 0 :(得分:0)

.animation(.easeInOut) ,. easeInout后没有括号