1
當我在cellForRowAtIndexPath
方法中出列可重用單元格時,我發現單元格邊界總是(320,44)。CellForRowAtIndexPath方法中的單元格邊界錯誤
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:kCellIdentifier];
if (!cell) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault
reuseIdentifier:kCellIdentifier_ActCalendarCell];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
}
cell.textLabel.text = @"test";
NSLog(@"%f,%f", cell.bounds.size.width, cell.bounds.size.height);
return cell;
}
是設計的嗎?何時何地可以獲得細胞的真實界限?
什麼是你想用的界限呢? – chedabob
@chedabob我想爲單元格添加頂部圓形矩形,就像[this](http://stackoverflow.com/questions/22410254/round-top-corners-of-a-uiview-and-add-border) –