Fix layout to show all of the topic

This commit is contained in:
ismailgulek
2020-10-06 00:59:30 +03:00
parent 2d85a78896
commit 30a00775dc
@@ -49,10 +49,7 @@ final class RoomInfoListViewController: UIViewController {
}()
private lazy var basicInfoView: RoomInfoBasicView = {
let view = RoomInfoBasicView.loadFromNib()
view.autoresizingMask = .flexibleWidth
view.translatesAutoresizingMaskIntoConstraints = true
return view
return RoomInfoBasicView.loadFromNib()
}()
private lazy var leaveAlertController: UIAlertController = {
@@ -127,6 +124,19 @@ final class RoomInfoListViewController: UIViewController {
return self.theme.statusBarStyle
}
override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()
let height = ceil(basicInfoView.systemLayoutSizeFitting(CGSize(width: view.bounds.width, height: 0)).height)
// compare heights to avoid infinite loop
if height != basicInfoView.frame.height {
var headerFrame = basicInfoView.frame
headerFrame.size.height = height
basicInfoView.frame = headerFrame
}
}
// MARK: - Private
private func updateSections(with viewData: RoomInfoListViewData) {