iphone - change UILabel frame dynamically in custom TableViewCell -


i have written subclass of uitableviewcell consists of various uilabels have defined style of uilabel in

  • (id)initwithstyle:(uitableviewcellstyle)style reuseidentifier:(nsstring*)reuseidentifier

and frame rect of labels in

  • (void)layoutsubviews

now after defining static rect uilabels want modify rect of uilabels, , write function in modifying frame labels, calling function doesn't modify frame of uilabels.
if has idea how achieve dynamic frame of labels please share it.

the way typically achieve implementing custom tableviewcell , implement own drawrect method in subview specify size of label, this:

@implementation compositesubviewbasedrestaurantcellcontentview  - (id)initwithframe:(cgrect)frame cell:(restaurantcell *)cell {     if (self = [super initwithframe:frame]) {         _cell = cell;          self.opaque = yes;         self.backgroundcolor = _cell.backgroundcolor;     }      return self; } - (void)drawrect:(cgrect)rect {     _highlighted ? [[uicolor whitecolor] set] : [[uicolor blackcolor] set];     [_cell.name drawatpoint:cgpointmake(11.0, 22.0) withfont:[uifont boldsystemfontofsize:17.0]]; } 

i think apple examples pretty good, instance table view suite:

https://developer.apple.com/library/ios/#samplecode/tableviewsuite/introduction/intro.html#//apple_ref/doc/uid/dts40007318


Comments

Popular posts from this blog

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -

delphi - How to convert bitmaps to video? -