0

这是一个屏幕截图,显示我所描述的内容:截屏

以及相关代码:

 - (NSInteger)spreadView:(MDSpreadView *)aSpreadView numberOfColumnsInSection:(NSInteger)section{
  return self.viewModel.matrix.width - 1;
}

- (NSInteger)spreadView:(MDSpreadView *)aSpreadView numberOfRowsInSection:(NSInteger)section{
  return self.viewModel.matrix.height - 1;
}

-(MDSpreadViewCell *)spreadView:(MDSpreadView *)aSpreadView cellForRowAtIndexPath:(MDIndexPath *)rowPath forColumnAtIndexPath:(MDIndexPath *)columnPath{
  MDSpreadViewCell *cell = [aSpreadView dequeueReusableCellWithIdentifier:@"InfoCell"];

  if (cell == nil){
    cell = [[[MDSpreadViewCell alloc] initWithStyle:MDSpreadViewCellStyleDefault reuseIdentifier:@"InfoCell"] autorelease];
  }

  cell.textLabel.text = ((DTVendor *)self.vendors[rowPath.row]).name;

  return cell;
}

-(CGFloat)spreadView:(MDSpreadView *)aSpreadView heightForRowHeaderInSection:(NSInteger)rowSection{
  return 200;
}

-(CGFloat)spreadView:(MDSpreadView *)aSpreadView widthForColumnHeaderInSection:(NSInteger)columnSection{
  return 200;
}

-(CGFloat)spreadView:(MDSpreadView *)aSpreadView heightForRowAtIndexPath:(MDIndexPath *)indexPath{
  return 200;
}

-(CGFloat)spreadView:(MDSpreadView *)aSpreadView widthForColumnAtIndexPath:(MDIndexPath *)indexPath{
  return 200;
}

-(id)spreadView:(MDSpreadView *)aSpreadView titleForHeaderInColumnSection:(NSInteger)section forRowAtIndexPath:(MDIndexPath *)rowPath{
  return ((DTVendor *)self.vendors[rowPath.row]).name;
}

-(id)spreadView:(MDSpreadView *)aSpreadView titleForHeaderInRowSection:(NSInteger)section forColumnAtIndexPath:(MDIndexPath *)columnPath{
  return ((DTVendor *)self.vehicleClasses[columnPath.column]).name;
}

MDScrollView 正在截断列标题标签,我不知道为什么。

4

1 回答 1

0

我假设您将返回最长标题文本的大小而不是固定大小,您可以保留最长标题的大小并在编辑标题文本时继续更新它。

于 2013-05-20T23:44:48.580 回答