Merge branch 'bugfix/insets' into 'develop'

fix inset defect for safe area

See merge request BPHV_MIPS/mvm_core_ui!114
This commit is contained in:
Pan, Xinlei (Ryan) 2019-08-13 16:24:18 -04:00
commit b65cb3ed5c
5 changed files with 16 additions and 1 deletions

View File

@ -48,6 +48,9 @@
- (void)setAsMolecule {
self.translatesAutoresizingMaskIntoConstraints = NO;
if (@available(iOS 11.0, *)) {
self.insetsLayoutMarginsFromSafeArea = NO;
}
}
- (void)reset {

View File

@ -61,6 +61,9 @@
tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
tableView.delegate = self;
tableView.dataSource = self;
if (@available(iOS 11.0, *)) {
tableView.insetsContentViewsToSafeArea = NO;
}
if ([tableView respondsToSelector:@selector(setCellLayoutMarginsFollowReadableWidth:)]) {
tableView.cellLayoutMarginsFollowReadableWidth = NO;
}

View File

@ -25,7 +25,6 @@ open class ThreeLayerTableViewController: MFProgrammaticTableViewController {
open override func updateViews() {
super.updateViews()
let width = view.bounds.width
MFStyler.setDefaultMarginsFor(contentView, size: width)
if let topView = topView as? MVMCoreViewProtocol {
topView.updateView(width)
showHeader(width)

View File

@ -37,6 +37,11 @@ open class MoleculeCollectionViewCell: UICollectionViewCell, MVMCoreUIMoleculeVi
}
isAccessibilityElement = false
contentView.isAccessibilityElement = false
if #available(iOS 11.0, *) {
insetsLayoutMarginsFromSafeArea = false
contentView.insetsLayoutMarginsFromSafeArea = false
contentView.preservesSuperviewLayoutMargins = false
}
// Covers the card when peaking.
peakingCover.backgroundColor = .white

View File

@ -80,6 +80,11 @@ import UIKit
public func setupView() {
selectionStyle = .none
if #available(iOS 11.0, *) {
insetsLayoutMarginsFromSafeArea = false
contentView.insetsLayoutMarginsFromSafeArea = false
contentView.preservesSuperviewLayoutMargins = false
}
}
// MARK: - MVMCoreUIMoleculeViewProtocol