我有CustomCellView
这是tableview中单元格的自定义视图。我在xib中有UIButton
,并将其设置为xib中的默认框架。UITableViewCell UIButton动态高度
在MainViewController
(viewDidLoad
)
// Get nib for custom cell
UINib *nib = [UINib nibWithNibName:@"CustomFeedCell" bundle:nil];
[self.mainTableView registerNib:nib forCellReuseIdentifier:@"CustomFeedCell"];
在cellForRow ...
CustomFeedCell *cell = [self.mainTableView dequeueReusableCellWithIdentifier:@"CustomFeedCell"];
// here i need to set UIButton frame (height) depending on image height.
// I have tried diferent ways and it always return height set in CustomCellView xib