0

我正在创建一个 TableView 并按如下方式创建它的单元格

static NSString *CellIdentifier = @"raffel";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
UIView *Imv=(UIView*)[cell viewWithTag:100];
UILabel *Title=(UILabel*)[cell viewWithTag:101];
UITextView *TicketDetails=(UITextView*)[cell viewWithTag:102];
UILabel *BDprice=(UILabel*)[cell viewWithTag:103];
UILabel *USDprice=(UILabel*)[cell viewWithTag:104];
UILabel *TickRema=(UILabel*)[cell viewWithTag:105];

NSLog(@"fram %@",Imv);

日志显示

fram <UIView: 0x1ed91bd0; frame = (0 171; 0 0); autoresize = TM+BM; tag = 100; layer = <CALayer: 0x1ed91c30>>

它显示零高度和宽度,但实际高度*宽度为 100*100

4

1 回答 1

0

在您的代码中实现此方法..

- (CGFloat) tableView: (UITableView *) tableView heightForRowAtIndexPath: (NSIndexPath *) indexPath
{
   return 100;
}
于 2013-07-31T11:39:31.550 回答