【问题标题】:'Type of expression is ambiguous without more context''没有更多上下文的表达类型是模棱两可的'
【发布时间】:2019-12-04 19:16:06
【问题描述】:

我在我的 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())
}

【问题讨论】:

  • 欢迎来到 SO!为了可读性,建议粘贴代码而不是图像。另见How to Ask。另外,显示更多代码。

标签: swift swiftui


【解决方案1】:

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-04-15
    • 2016-12-10
    • 2018-02-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-12-16
    • 1970-01-01
    相关资源
    最近更新 更多