我有CustomCellView
哪个是表格视图中单元格的自定义视图。我有UIButton
xib 并在 xib 中设置它的默认框架。
在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