小编Jen*_*sen的帖子

如何通过单击按钮转到另一个视图

我的代码中有一个按钮,并且有一个名为LogindView.swift的文件

单击按钮时,我无法获取打开另一个视图文件的代码。

谁能给我一个例子。

在我的按钮操作中,我尝试编写LogindView(),但我只是警告我。“'LogindView'初始化程序的结果未使用”

    Button(action: {
            // Do action
            LogindView()
        }, label: {
            //** Label text
            Text("Logind")
                .font(.headline)
                .padding(.all)
                .foregroundColor(Color.white)
        })
        .background(Color.blue)
Run Code Online (Sandbox Code Playgroud)

swiftui xcode11

4
推荐指数
2
解决办法
661
查看次数

标签 统计

swiftui ×1

xcode11 ×1