inf*_*eqd 16 iphone cocoa-touch uitableview uikit ios
我将如何使用UINibs在iOS5.0中实例化和使用UITableViewCell作为tableview.我知道有一个registerNib:forCellReuseIdentifier:在iOS5.0中也需要使用,但我不知道如何使用它
在此先感谢任何帮助
jrt*_*ton 42
可以组合步骤2和3,因此您可以在viewDidLoad中使用以下行:
[self.tableView registerNib:[UINib nibWithNibName:@"Cell" bundle:nil] forCellReuseIdentifier:@"Cell"];
Run Code Online (Sandbox Code Playgroud)
然后,在cellForRowAtIndexPath中,如果您需要来自笔尖的其中一个单元格,则将其出列:
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell"];
Run Code Online (Sandbox Code Playgroud)
这将从nib创建一个新实例,或者使现有单元格出列.
| 归档时间: |
|
| 查看次数: |
20335 次 |
| 最近记录: |