Open insurgentZhao opened 5 years ago
cell中有3个view 需要自适应高度 cell根据这三个view再自适应高度 类似demo中朋友圈
自定义view参考demo在内部实现了高度自适应 使用此方法实现view的高度自适应 [self.contentContainerView setUpContentArrayWithContentArray:model.contentArr]; self.imageContainer.imageUrlStr = model.poster; [self.docContainer setUpDocArrayWithDocArray:model.docsArr]; 使用下面三个方法 实现对应父视图的自适应高度 [self.desContainView setupAutoHeightWithBottomView:self.docContainer bottomMargin:15]; [self.containView setupAutoHeightWithBottomView:self.desContainView bottomMargin:50]; [self setupAutoHeightWithBottomView:self.containView bottomMargin:15]; desContainView的子view为 contentContainerView imageContainer docContainer containView的子view为 desContainView cell根据containView自适应高度 cell自使用高度代码为 ` return [self.tableView cellHeightForIndexPath:indexPath model:model keyPath:@"model" cellClass:currentClass contentViewWidth:[self cellContentViewWith]];
[self.contentContainerView setUpContentArrayWithContentArray:model.contentArr]; self.imageContainer.imageUrlStr = model.poster; [self.docContainer setUpDocArrayWithDocArray:model.docsArr];
[self.desContainView setupAutoHeightWithBottomView:self.docContainer bottomMargin:15]; [self.containView setupAutoHeightWithBottomView:self.desContainView bottomMargin:50]; [self setupAutoHeightWithBottomView:self.containView bottomMargin:15];
` 界面布局如下图 请问是什么原因造成的 谢谢
cell中有3个view 需要自适应高度 cell根据这三个view再自适应高度 类似demo中朋友圈
自定义view参考demo在内部实现了高度自适应 使用此方法实现view的高度自适应
[self.contentContainerView setUpContentArrayWithContentArray:model.contentArr]; self.imageContainer.imageUrlStr = model.poster; [self.docContainer setUpDocArrayWithDocArray:model.docsArr];
使用下面三个方法 实现对应父视图的自适应高度[self.desContainView setupAutoHeightWithBottomView:self.docContainer bottomMargin:15]; [self.containView setupAutoHeightWithBottomView:self.desContainView bottomMargin:50]; [self setupAutoHeightWithBottomView:self.containView bottomMargin:15];
desContainView的子view为 contentContainerView imageContainer docContainer containView的子view为 desContainView cell根据containView自适应高度 cell自使用高度代码为 ` return [self.tableView cellHeightForIndexPath:indexPath model:model keyPath:@"model" cellClass:currentClass contentViewWidth:[self cellContentViewWith]];` 界面布局如下图 请问是什么原因造成的 谢谢![img_2108](https://user-images.githubusercontent.com/20851549/52936520-5cb5b000-3397-11e9-818a-4e71b6dbda43.PNG)