简体   繁体   English

UITableViewController中的UITextField

[英]UITextField in UITableViewController

I can't find a question like this. 我找不到这样的问题。 I searched all of the Internet but nobody ask this question. 我搜索了整个Internet,但是没有人问这个问题。 Even Apple's tutorials, there is no example. 即使是苹果公司的教程,也没有例子。 Here is my what I want to do. 这是我想做的。 I want to create an app like Reminders or Wunderlist. 我想创建一个提醒或奇妙清单之类的应用。 I want to emphasize the UITextField of UITableViewCell's first cell as text input. 我想强调UITableViewCell第一个单元格的UITextField作为文本输入。 My first cell is a static cell which is UITextField and the other cell's are the results of UITextField. 我的第一个单元格是一个静态单元格,它是UITextField,其他单元格是UITextField的结果。 For example: 例如:

  • Static cell (UITextField) 静态单元格(UITextField)
  • dynamic cell (Label) 动态单元格(标签)
  • dynamic cell (Label) 动态单元格(标签)
  • ... ...

There is no button for UITextField. UITextField没有按钮。 I want to get input from keyboard's return like Reminders.app due to I must implement UITextFieldDelegete and equalize in viewDidLoad like textField.delagate = self . 由于我必须实现UITextFieldDelegete并在viewDidLoad中进行均衡(如textField.delagate = self所以我想从键盘返回的内容(例如Reminders.app)中获取输入。 The problem starts here. 问题从这里开始。 I can connect outlets in UITableViewCell (for UITextField and cells' labels) but in UITableViewCell's instance method, there is no viewDidLoad method and it disallow to use UITextFieldDelagete which can require to get input without using any button. 我可以在UITableViewCell中连接出口(用于UITextField和单元格的标签),但是在UITableViewCell的实例方法中,没有viewDidLoad方法,并且不允许使用UITextFieldDelagete,这可能需要不使用任何按钮即可获取输入。 If I use ViewController (not UITableViewController), I can easily connect outlets and use UITextFieldDelegate. 如果使用ViewController(而不是UITableViewController),则可以轻松连接插座并使用UITextFieldDelegate。 How can I solve this problem? 我怎么解决这个问题? Which point I missed? 我错过了哪一点?

Please Check Screenshot how to add any Control into UITableViewController do not forget to change Static cell instead of dynamic prototype in tableView Property. 请检查屏幕快照,如何将任何控件添加到UITableViewController中,不要忘记在tableView属性中更改静态单元格而不是动态原型。

IBOUTLETs will connects with your ViewController , not with Custom Cell. IBOUTLETs将与您的ViewController连接,而不与自定义单元连接。

在此处输入图片说明

How to Set OUTLEts in TableViewController : ScreenShot 如何在TableViewController中设置OUTLEts:ScreenShot

只需您即可

Please feel free to ask 请随时问

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在UITableViewController的顶部插入一个UITextField - Insert a UITextField on top of a UITableViewController UITableViewController和UITextField键盘 - UITableViewController and UITextField keyboard UITableViewController中的customCell UITextField在运行时快速期间未显示 - customCell UITextField in UITableViewController not displaying during runtime swift 在UITableViewController上编辑UITextField时滚动区域不正确 - Scroll area incorrect when editing UITextField on UITableViewController 滚动UITableviewController时隐藏包含UITextfield的UITableviewcell - UITableviewcell containing UITextfield hides while scrolling UITableviewcontroller 约束不适用于 UITableViewController 的 Cell 内的 UITextField - constraints are not applied to UITextField inside Cell of UITableViewController 如何将触摸事件从UITextField转发到UICollectionViewController / UITableViewController? - How to forward touch event from UITextField to UICollectionViewController / UITableViewController? 是UITableViewController吗? - Is it a UITableViewController? iOS:show segue阻止UITextField获得焦点时UITableViewController自动滚动 - iOS: show segue prevents UITableViewController to auto scroll when UITextField gets focus iOS7滚动到UITableViewController的行,同时以适当的偏移量编辑UITableViewCell中的UITextField - iOS7 scroll to row of UITableViewController while editing UITextField in UITableViewCell with proper offset
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM