Picker in SwiftUI Form turns gray after selecting a value

和自甴很熟 提交于 2021-01-28 07:24:43

问题


For some reason the picker in my SwiftUI Form turns gray after I select a value.

My code:

Form {
  Section {
    TextField("title", text: $title)
      Picker(selection: $category, label: Text("category")) {
        ForEach(0..<categories.count) { index in
            Text(categories[index]).tag(index)
      }
    }
  }
}

Here is how it looks on a iPhone 12 simulator

来源:https://stackoverflow.com/questions/65405759/picker-in-swiftui-form-turns-gray-after-selecting-a-value

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!