以下のコードを試してみましたが、出力は常に 0.000000 です。
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"CellNotification";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil)
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier];
cell.textLabel.text = @"Test Test Test. I am a cell.";
NSLog(@"%f", cell.textLabel.frame.size.width);
return cell;
}
デフォルトの UITableViewCell の幅を知るにはどうすればよいですか? UITableViewCell の高さを設定する必要があるため、この情報が必要です
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath