ios - 我想知道为什么当我单击 Command + 单击文本框时,下拉菜单没有给我“嵌入按钮”选项
问题描述
我想知道为什么当我单击 Command + 单击文本框时,下拉菜单没有给我“嵌入按钮”选项
试图向您展示我正在参加的课程中,我的讲师有一个下拉菜单,他可以在其中使用“嵌入按钮”,而当我执行与他完全相同的步骤时,我没有
import SwiftUI
struct ContentView: View {
@State var alertIsVisible: Bool = false
var body: some View {
VStack {
// Target row
HStack {
Text("Put the bullseye as close as you can to:")
Text(/*@START_MENU_TOKEN@*/"100"/*@END_MENU_TOKEN@*/)
}
// Slider Row
HStack {
Text("1")
Slider(value: .constant(10))
Text("100")
}
// Button row
Button(action: {
print("Button pressed!")
self.alertIsVisible = true
}) {
Text("Hit me please!")
}
.alert(isPresented: $alertIsVisible) { () -> Alert in
return Alert(title: Text("Hello there!"), message: Text("This is my first pop-up."), dismissButton: .default(Text("Awesome!")))
}
// Score row
HStack {
Text("Start Over")
}
}
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView() .previewLayout(PreviewLayout.fixed(width: 896, height: 414))
}
}
解决方案
推荐阅读
- kubernetes - k6: k6 --out json - 打开 ./test.json: 权限被拒绝
- c# - 使用 HttpClient 时收到无效参数
- python - 从文件中读取值并将它们存储在字典中
- javascript - 如何在我的反应组件中快进音频?
- google-cloud-platform - 向 cloud-speech-to-text api 添加说话者注释(比如 id、name),并将其包含在由 cloud-speech-to-text api 生成的输出 json 中
- javascript - CubeTextureLoader() 不工作。或者我做错了什么
- r - 将数据集中的每个单元格除以 R 中缺少单元格的列总和
- javascript - Javascript:如何获取对象或数组的`prototype`或`__proto__`的所有属性
- javascript - 点击提交时如何显示表格并将表单值传递给html和js后端?
- javascript - 如何按月和年对日期数组进行分组