iphone - How do I keep MDScrollView from truncating my row headers and making my cells look bad? -
here's screenshot show describing:
and relevant code:
- (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 truncating column header labels , can't figure out why.
i assume return size of longest header text instead of fixed size, keep size of longest header , keep updating if headers text edited.
Comments
Post a Comment