将UITextField添加到UITableViewCell [英] Adding UITextField to UITableViewCell

查看:85
本文介绍了将UITextField添加到UITableViewCell的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在这个问题上看过无数的答案,但找不到我要找的东西。

I've looked through countless SO answers on this subject and cannot find what I am looking for.

我有一个我在xib文件中创建的视图。它有一个 UITableView 作为子视图。我将委托和数据委托连接到控制器,它的工作原理。

I have a view I created in a xib file. It has a UITableView as a subview. I hooked up the delegate and data delegates to the controller and it works.

现在,我想在 UITableView 中加载自定义单元格 - 单元格需要 UILabel 一个 UITextField 和三个 UIButtons 仅在条件为满足。我的问题很简单:

Now, I want to load a custom cell in the UITableView - the cell needs to have a UILabel a UITextField and three UIButtons that are only visible when a condition is met. My question is simply this:

我可以在单独的xib文件中创建一个自定义单元格,其中包含我需要的这些元素 - 在tableview中加载它并连接UI元素到我的viewController?

Can I create a custom cell in a separate xib file with these elements that I need - the load it in the tableview and connect the UI elements to my viewController?

我已尝试过上述内容,但IB不允许我与视图控制器建立连接。

I've tried the above but IB does not allow me to make connections to my view controller.

有人可以给我一些提示吗?

Can anyone gov me some tips here?

谢谢!

推荐答案

供参考,

自定义TableViewCell教程1

自定义TableViewCell教程2

这篇关于将UITextField添加到UITableViewCell的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆