多くのアプリでそれを見てきましたが、オンラインで役立つチュートリアルが見つかりません。Swiftでそのようなことをどのように実現できますか?
1 に答える
1
Okay, So you need to add a UITextField
to your NavigationBar. Here's the code that should help you :
var textField=UITextField()
//Configure the size and other properties..
self.navigationItem.titleView = textField
And for the button on the right, you should do this :
var button = UIBarButtonItem(title: "FOO", style: UIBarButtonItemStyle.Plain, target: self, action: "FOO")
self.navigationItem.rightBarButtonItem = button
That's all done there, but I strongly think that you shouldn't add a login form to your navigation bar, it's very impractical.
于 2015-06-16T17:20:00.913 に答える