forked from organicmaps/organicmaps
[iOS] fix rotation and other layout issues on bookmarks screen (especially on iOS 9)
This commit is contained in:
parent
62342ae551
commit
7c895a22b1
4 changed files with 23 additions and 18 deletions
|
@ -39,8 +39,8 @@ class DownloadedBookmarksViewController: MWMViewController {
|
|||
tableView.reloadData()
|
||||
}
|
||||
|
||||
override func viewWillLayoutSubviews() {
|
||||
super.viewWillLayoutSubviews()
|
||||
override func viewDidLayoutSubviews() {
|
||||
super.viewDidLayoutSubviews()
|
||||
var f = bottomView.frame
|
||||
let s = bottomView.systemLayoutSizeFitting(CGSize(width: tableView.width, height: 1),
|
||||
withHorizontalFittingPriority: .required,
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
|
||||
<capability name="Aspect ratio constraints" minToolsVersion="5.1"/>
|
||||
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
|
@ -93,7 +94,7 @@
|
|||
</view>
|
||||
<view contentMode="scaleToFill" id="Q8q-x4-Mvv">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<tableView opaque="NO" clipsSubviews="YES" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" bouncesZoom="NO" style="grouped" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="18" sectionFooterHeight="18" translatesAutoresizingMaskIntoConstraints="NO" id="i5M-Pr-FkT">
|
||||
<rect key="frame" x="0.0" y="20" width="375" height="647"/>
|
||||
|
@ -106,8 +107,11 @@
|
|||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="EF0-Bq-c6F">
|
||||
<rect key="frame" x="0.0" y="20" width="375" height="647"/>
|
||||
<subviews>
|
||||
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="img_empty_bookmarks" translatesAutoresizingMaskIntoConstraints="NO" id="ahy-M3-meH">
|
||||
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" horizontalCompressionResistancePriority="749" verticalCompressionResistancePriority="749" image="img_empty_bookmarks" translatesAutoresizingMaskIntoConstraints="NO" id="ahy-M3-meH">
|
||||
<rect key="frame" x="88" y="40" width="200" height="200"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" secondItem="ahy-M3-meH" secondAttribute="height" multiplier="1:1" id="OJM-v8-f4d"/>
|
||||
</constraints>
|
||||
</imageView>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Download new places" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="13b-uj-bGK">
|
||||
<rect key="frame" x="16" y="256" width="343" height="21.5"/>
|
||||
|
@ -162,6 +166,7 @@
|
|||
<constraints>
|
||||
<constraint firstItem="1gY-vv-QfN" firstAttribute="trailing" secondItem="13b-uj-bGK" secondAttribute="trailing" id="24k-XV-fh7"/>
|
||||
<constraint firstItem="kER-re-108" firstAttribute="top" secondItem="1gY-vv-QfN" secondAttribute="bottom" constant="26" id="Hz8-vx-8Au"/>
|
||||
<constraint firstAttribute="bottom" relation="greaterThanOrEqual" secondItem="kER-re-108" secondAttribute="bottom" constant="16" id="IvI-4E-BDa"/>
|
||||
<constraint firstItem="13b-uj-bGK" firstAttribute="leading" secondItem="EF0-Bq-c6F" secondAttribute="leading" constant="16" id="JLq-wb-chA"/>
|
||||
<constraint firstItem="1gY-vv-QfN" firstAttribute="top" secondItem="13b-uj-bGK" secondAttribute="bottom" constant="8" id="TND-0r-7FO"/>
|
||||
<constraint firstItem="ahy-M3-meH" firstAttribute="centerX" secondItem="EF0-Bq-c6F" secondAttribute="centerX" id="VjC-b4-t1W"/>
|
||||
|
@ -189,7 +194,7 @@
|
|||
<constraint firstItem="Ceu-pi-1ck" firstAttribute="top" secondItem="i5M-Pr-FkT" secondAttribute="top" id="pYZ-O3-uHP"/>
|
||||
</constraints>
|
||||
<viewLayoutGuide key="safeArea" id="Ceu-pi-1ck"/>
|
||||
<point key="canvasLocation" x="-437" y="21"/>
|
||||
<point key="canvasLocation" x="-442" y="26"/>
|
||||
</view>
|
||||
</objects>
|
||||
<resources>
|
||||
|
|
|
@ -1,18 +1,14 @@
|
|||
fileprivate class ContentCell: UICollectionViewCell {
|
||||
var view: UIView? {
|
||||
didSet {
|
||||
oldValue?.removeFromSuperview()
|
||||
if let view = view {
|
||||
if let view = view, view != oldValue {
|
||||
oldValue?.removeFromSuperview()
|
||||
view.frame = contentView.bounds
|
||||
contentView.addSubview(view)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override func prepareForReuse() {
|
||||
super.prepareForReuse()
|
||||
view?.removeFromSuperview()
|
||||
}
|
||||
|
||||
override func layoutSubviews() {
|
||||
super.layoutSubviews()
|
||||
if let view = view {
|
||||
|
@ -193,14 +189,15 @@ class TabView: UIView {
|
|||
}
|
||||
|
||||
override func layoutSubviews() {
|
||||
super.layoutSubviews()
|
||||
|
||||
slidingViewWidth.constant = pageCount > 0 ? bounds.width / CGFloat(pageCount) : 0
|
||||
tabsLayout.invalidateLayout()
|
||||
tabsContentLayout.invalidateLayout()
|
||||
super.layoutSubviews()
|
||||
slidingViewWidth.constant = pageCount > 0 ? bounds.width / CGFloat(pageCount) : 0
|
||||
tabsContentCollectionView.layoutIfNeeded()
|
||||
if selectedIndex >= 0 {
|
||||
tabsContentCollectionView.scrollToItem(at: IndexPath(item: selectedIndex, section: 0), at: .left, animated: false)
|
||||
tabsContentCollectionView.scrollToItem(at: IndexPath(item: selectedIndex, section: 0),
|
||||
at: .left,
|
||||
animated: false)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -233,8 +230,10 @@ extension TabView : UICollectionViewDataSource {
|
|||
|
||||
extension TabView : UICollectionViewDelegateFlowLayout {
|
||||
func scrollViewDidScroll(_ scrollView: UIScrollView) {
|
||||
let scrollOffset = scrollView.contentOffset.x / scrollView.contentSize.width
|
||||
slidingViewLeft.constant = scrollOffset * bounds.width
|
||||
if scrollView.contentSize.width > 0 {
|
||||
let scrollOffset = scrollView.contentOffset.x / scrollView.contentSize.width
|
||||
slidingViewLeft.constant = scrollOffset * bounds.width
|
||||
}
|
||||
}
|
||||
|
||||
func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) {
|
||||
|
|
|
@ -655,6 +655,7 @@ using namespace osm_auth_ios;
|
|||
navigationBar.barTintColor = [UIColor primary];
|
||||
navigationBar.titleTextAttributes = [self navigationBarTextAttributes];
|
||||
navigationBar.translucent = NO;
|
||||
[navigationBar setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault];
|
||||
navigationBar.shadowImage = [UIImage new];
|
||||
auto backImage = [[UIImage imageNamed:@"ic_nav_bar_back_sys"]
|
||||
imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
|
||||
|
|
Loading…
Add table
Reference in a new issue