[ios] Fixed layou bug on elder iOS.

This commit is contained in:
VladiMihaylenko 2017-04-26 15:38:43 +03:00 committed by r.kuznetsov
parent f090ccf3e9
commit 2017d11f5d
2 changed files with 20 additions and 3 deletions

View file

@ -3,6 +3,18 @@ final class FilterCollectionHolderCell: MWMTableViewCell {
@IBOutlet weak var collectionView: UICollectionView!
@IBOutlet private weak var collectionViewHeight: NSLayoutConstraint!
private weak var tableView: UITableView?
override var frame: CGRect {
didSet {
guard #available(iOS 10, *) else {
if (frame.size.height < 1 /* minimal correct height */) {
frame.size.height = collectionViewHeight.constant
tableView?.refresh()
}
return
}
}
}
private func layout() {
collectionView.setNeedsLayout()
@ -10,13 +22,18 @@ final class FilterCollectionHolderCell: MWMTableViewCell {
collectionViewHeight.constant = collectionView.contentSize.height
}
func config() {
func config(tableView: UITableView?) {
layout()
collectionView.allowsMultipleSelection = true;
isSeparatorHidden = true
backgroundColor = UIColor.pressBackground()
guard #available(iOS 10, *) else {
self.tableView = tableView
return
}
}
override func layoutSubviews() {
super.layoutSubviews()
layout()

View file

@ -143,7 +143,7 @@ void configButton(UIButton * button, NSString * primaryText, NSString * secondar
- (void)initialTypeConfig
{
[self.type config];
[self.type configWithTableView:self.tableView];
[self resetTypes];
}