我有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