これは、私が説明していることを示すスクリーンショットです。
そして関連するコード:
- (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 が列ヘッダー ラベルを切り捨てていますが、その理由がわかりません。