Skip to content

Commit

Permalink
[Fix] #217 - 블로그 셀 크기 기기대응
Browse files Browse the repository at this point in the history
  • Loading branch information
yungu0010 committed Jul 22, 2022
1 parent d71125f commit 89f68de
Showing 1 changed file with 24 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,29 @@ extension ReviewDetailVC {
return textView.frame.height
}

private func caculateBlogReviewHeight() -> CGFloat {
let textView = UITextView()
textView.text =
"""
"""
textView.font = .NotoRegular(size: 12)
textView.sizeToFit()
var contentHeight = textView.frame.height

let titleTextView = UITextView()
titleTextView.text = "제목"
titleTextView.font = .NotoBold(size: 14)
var titleHeight = titleTextView.frame.height

var totalHeight = titleHeight + contentHeight + 10 + 28 + 28

return totalHeight

}

private func addObserver() {
addObserverAction(.reviewPhotoClicked) { noti in
if let slideData = noti.object as? ImageSlideDataModel {
Expand Down Expand Up @@ -452,7 +475,7 @@ extension ReviewDetailVC: UICollectionViewDelegateFlowLayout {
return CGSize(width: cellWidth, height: cellHeight)
} else {
let cellWidth = width * 335/375
let cellHeight = cellWidth * 156/335
let cellHeight = caculateBlogReviewHeight()
return CGSize(width: cellWidth, height: cellHeight)
}
}
Expand Down

0 comments on commit 89f68de

Please sign in to comment.