美文网首页swift
苹果官方 SwiftUI 教程 Working with UI

苹果官方 SwiftUI 教程 Working with UI

作者: Eddy_0 | 来源:发表于2019-06-24 10:20 被阅读1次

    教程地址
    在添加navigationBarItem时,是这么写的:

    .navigationBarItems(trailing:
    PresentationButton(destination: ProfileHost()) {
    Image(systemName: "person.crop.circle")
    .imageScale(.large)
    .accessibility(label: Text("User Profile"))
    .padding()
    }
    )
    按照上面的写法会有警告提示!


    屏幕快照2019-06-24上午10.16.02.png

    查看官方 完整版的demo,依旧有警告,改成下面的代码就好了.

    .navigationBarItems(trailing:
    PresentationButton(
    Image(systemName: "person.crop.circle")
    .imageScale(.large)
    .accessibility(label: Text("User Profile"))
    .padding(),
    destination: ProfileHost()))
    }

    相关文章

      网友评论

        本文标题:苹果官方 SwiftUI 教程 Working with UI

        本文链接:https://www.haomeiwen.com/subject/hucnqctx.html