【发布时间】:2012-11-29 09:21:09
【问题描述】:
我在.xib中设计了UITableViewCell,它的高宽分别是:
从 Xcode 中检索 -> 显示尺寸检查器。
Width : 358 Height : 562
TableView 委托:
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
return 800;
}
我在尝试什么?
在下面的方法中,我试图找到单元格的宽度和高度,以便在单元格中画一条垂直线。
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath: (NSIndexPath *)indexPath
{
/* FINDING THE WIDTH AND HEIGHT */
my Custom Cell instance say : cell
cell.contentView.bounds.size.width Give me the value -> 320,
cell.contentView.bounds.size.height Gives me the value -> 44,
}
问题?..
如何获得自定义单元格的正确高度/宽度?
如果我的理解有误,请告知?
【问题讨论】:
标签: iphone objective-c cocoa-touch ios4