Iphone UITableViewCell customazitaion [英] Iphone UITableViewCell customazitaion

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

问题描述

我有一个UInavigation控制器,带有自定义UITableViewCells的UITabelView,我将为这些自定义单元格创建4个不同的xib文件,我将从中获取用户输入。

I have a UInavigation controller, UITabelView with customized UITableViewCells, which I will create 4 different xib files for that custom cells, which I will get user input from them.

我在这里有点困惑,据说每个视图都应该在Iphone中有自己的控制器,所以我会在每个页面(UITableView)的堆栈上推送一个新的UItableviewcontroller子类,理论上它应该负责代理那张桌子上的uicomponents。但是每个UItableVIew都包含自定义单元格(xibs),

I am a bit confused here, it is said every view should have its own controller in Iphone, so I will push a new subclass of UItableviewcontroller on stack for each page(UITableView), and in theory it should be responsible for the delegations of the uicomponents on that table. But each UItableVIew consists of customized cells(xibs),

所以
-我还需要为每个自定义单元格使用不同的控制器吗?

So -Do I also need a different controller for each customized cell?

- 如果是这样,我在哪里可以将这些ui组件的委托方法放在自定义单元格上?

-If so, where can I put the delegation methods of those ui components on the custom cells?

- 这个层次结构是否正确?

-is this hiearchy correct?

UINavigationController - > UITableViewControllersSubclasses - > customUITableViewCellcontrollers

UINavigationController--> UITableViewControllersSubclasses -->customUITableViewCellcontrollers

推荐答案

否。你需要为每个自定义单元格设置不同的控制器。

No. You do not need a different controller for each customized cell.


据说每个视图都应该有它的
在iphone中拥有控制器

it is said every view should have its own controller in Iphone

这不是真的。实际上,视图控制器通常管理视图层次结构而不是视图。虽然视图控制器与视图相关联,但此视图只是屏幕内容价值的整个视图层次结构的根(在iPhone应用程序中)。

This is not true. Actually, a view controller typically manages a view hierarchy rather than a view. Although the view controller is associated with a view, this view is just the root of the whole view hierarchy of a screen’s worth of content (in iPhone applications).

From < a href =http://developer.apple.com/library/ios/#featuredarticles/ViewControllerPGforiPhoneOS/Introduction/Introduction.html#//apple_ref/doc/uid/TP40007457 =nofollow> View Controller Programming Guide for iOS :


每个视图控制器负责管理
应用程序用户的独立部分
接口。查看
控制器与单个视图对象直接关联
,但
对象通常只是
a的根视图,更大的视图层次结构是
,也由查看控制器。
视图控制器充当
视图层次结构的
中央协调代理,处理其视图与任何相关的
控制器或数据对象之间的交换
。单个
视图控制器通常管理与单个
屏幕内容相关联的
视图,尽管在
iPad应用程序中,这可能并不总是

Each view controller is responsible for managing a discrete part of your application’s user interface. View controllers are directly associated with a single view object but that object is often just the root view of a much larger view hierarchy that is also managed by the view controller. The view controller acts as the central coordinating agent for the view hierarchy, handling exchanges between its views and any relevant controller or data objects. A single view controller typically manages the views associated with a single screen’s worth of content, although in iPad applications this may not always be the case.

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

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