【发布时间】:2021-11-11 20:28:29
【问题描述】:
I have a Picker and when one of the selections is selected I'm trying to make it call on my camera view, but nothing happens.我试图调用一个函数来让它打印,但这也不起作用。这是代码
Picker(selection: $selection, label: Text("Discover Plug")) {
ForEach(vm.dataSet, id:\.self) { item in
Text(item.Device).tag(item.Device)
}.onTapGesture{
//CameraView()
//print("selected")
Selected()
}
}
func Selected() {
print("selected")
}
我尝试将 .onTapGesture 移动到不同的位置,还尝试将文本放在按钮中,但没有成功,我们将不胜感激任何帮助或建议
【问题讨论】: