最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

swift - I am unable to add done button to keyboard toolbar for TextField view - Stack Overflow

programmeradmin3浏览0评论
TextField(text: $viewModel.assignee, prompt: Text(" Assignee"), label: {
                
            })
            .autocorrectionDisabled(true)
            .textInputAutocapitalization(.never)
            .focused($isTextEditorFocused)
            .toolbar(content: {
                ToolbarItemGroup(placement: .keyboard) {
                    Spacer()
                    Button("Done") {
                        isTextEditorFocused = false
                    }
                }
            })
            .font(.custom("ProximaNova-Regular", size: 16))
            .frame(height: 30)
            .frame(maxWidth: .infinity)
            .overlay(content: {
                RoundedRectangle(cornerRadius: 4)
                    .stroke(Color.gray , lineWidth: 0.5)
                
            })
            .padding(.bottom, 10)
            .padding(.horizontal , 10)
            .disabled(!viewModel.isEditEnabled)

For the above code I am unable to see the done button on the keyboard. Any help would be appreciated.

发布评论

评论列表(0)

  1. 暂无评论