gpt4 book ai didi

swift - 键盘顶部的工具栏,带有完成按钮和文本字段导航

转载 作者:行者123 更新时间:2023-11-30 10:14:38 27 4
gpt4 key购买 nike

我在许多应用程序中都看到过这一点,但我在网上找不到有用的教程。我怎样才能在 Swift 中实现类似的东西?

enter image description here

最佳答案

好的,所以您需要向导航栏添加一个UITextField。这是应该对您有帮助的代码:

var textField=UITextField()
//Configure the size and other properties..
self.navigationItem.titleView = textField

对于右侧的按钮,您应该这样做:

var button = UIBarButtonItem(title: "FOO", style: UIBarButtonItemStyle.Plain, target: self, action: "FOO")
self.navigationItem.rightBarButtonItem = button

这一切都完成了,但我强烈认为您不应该在导航栏中添加登录表单,这是非常不切实际的。

关于swift - 键盘顶部的工具栏,带有完成按钮和文本字段导航,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30873923/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com