Skip to content

Commit 4590486

Browse files
committed
Xcode9 + iPhoneX适配
1.Xcode9 Demo中的Xib、Storyboard适配 2.Demo顶部按钮的iPhoneX适配
1 parent 4e8be61 commit 4590486

File tree

5 files changed

+52
-43
lines changed

5 files changed

+52
-43
lines changed

MJRefresh.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'MJRefresh'
3-
s.version = '3.1.12'
3+
s.version = '3.1.13'
44
s.summary = 'An easy way to use pull-to-refresh'
55
s.homepage = 'https://github.com/CoderMJLee/MJRefresh'
66
s.license = 'MIT'

MJRefreshExample/Base.lproj/Main.storyboard

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1-
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10116" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="06B-cM-i4B">
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13196" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="06B-cM-i4B">
3+
<device id="retina4_7" orientation="portrait">
4+
<adaptation id="fullscreen"/>
5+
</device>
36
<dependencies>
4-
<deployment identifier="iOS"/>
5-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
7+
<deployment version="1792" identifier="iOS"/>
8+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13173"/>
9+
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
610
</dependencies>
711
<scenes>
812
<!--Tab Bar Controller-->
@@ -13,7 +17,7 @@
1317
<tabBar key="tabBar" contentMode="scaleToFill" id="BAy-Gq-nS1">
1418
<rect key="frame" x="0.0" y="0.0" width="320" height="49"/>
1519
<autoresizingMask key="autoresizingMask"/>
16-
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
20+
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
1721
</tabBar>
1822
<connections>
1923
<segue destination="X1t-Y8-mVA" kind="relationship" relationship="viewControllers" id="Fa4-Fv-qWQ"/>
@@ -29,9 +33,9 @@
2933
<objects>
3034
<tableViewController id="bYG-Kt-eGn" customClass="MJSingleViewController" sceneMemberID="viewController">
3135
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" id="kOg-FB-cx3">
32-
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
36+
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
3337
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
34-
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
38+
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
3539
<connections>
3640
<outlet property="dataSource" destination="bYG-Kt-eGn" id="UPe-dz-o9s"/>
3741
<outlet property="delegate" destination="bYG-Kt-eGn" id="aly-IU-bHB"/>
@@ -49,7 +53,6 @@
4953
<navigationController id="MBo-Zo-CjM" sceneMemberID="viewController">
5054
<tabBarItem key="tabBarItem" title="Item" id="hIa-cL-CHu"/>
5155
<navigationBar key="navigationBar" contentMode="scaleToFill" id="gXg-XT-JWK">
52-
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
5356
<autoresizingMask key="autoresizingMask"/>
5457
</navigationBar>
5558
<connections>
@@ -65,9 +68,9 @@
6568
<objects>
6669
<tableViewController storyboardIdentifier="1" id="m94-yi-d3y" customClass="MJSingleViewController" sceneMemberID="viewController">
6770
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" id="cbU-lV-mY4">
68-
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
71+
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
6972
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
70-
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
73+
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
7174
<connections>
7275
<outlet property="dataSource" destination="m94-yi-d3y" id="tv3-44-MfP"/>
7376
<outlet property="delegate" destination="m94-yi-d3y" id="IYQ-uj-ZZ4"/>
@@ -83,7 +86,7 @@
8386
<objects>
8487
<navigationController storyboardIdentifier="0" id="06B-cM-i4B" customClass="MJNavigationController" sceneMemberID="viewController">
8588
<navigationBar key="navigationBar" contentMode="scaleToFill" id="Kj6-u7-ICR">
86-
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
89+
<rect key="frame" x="0.0" y="20" width="375" height="44"/>
8790
<autoresizingMask key="autoresizingMask"/>
8891
</navigationBar>
8992
<connections>
@@ -99,29 +102,29 @@
99102
<objects>
100103
<tableViewController id="3cf-VR-wv0" customClass="MJExampleViewController" sceneMemberID="viewController">
101104
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" id="IS9-AM-1DI">
102-
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
105+
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
103106
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
104-
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
107+
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
105108
<prototypes>
106109
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="example" textLabel="veW-N9-syp" detailTextLabel="Iv7-PA-lBt" style="IBUITableViewCellStyleSubtitle" id="xJS-7u-6pG">
107-
<rect key="frame" x="0.0" y="86" width="600" height="44"/>
110+
<rect key="frame" x="0.0" y="22" width="375" height="44"/>
108111
<autoresizingMask key="autoresizingMask"/>
109112
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="xJS-7u-6pG" id="rMg-IH-g5u">
110-
<rect key="frame" x="0.0" y="0.0" width="600" height="43.5"/>
113+
<rect key="frame" x="0.0" y="0.0" width="375" height="43.5"/>
111114
<autoresizingMask key="autoresizingMask"/>
112115
<subviews>
113116
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Title" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="veW-N9-syp">
114-
<rect key="frame" x="15" y="6" width="31.5" height="19.5"/>
117+
<rect key="frame" x="16" y="6" width="31.5" height="19.5"/>
115118
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
116119
<fontDescription key="fontDescription" type="system" pointSize="16"/>
117-
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
120+
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
118121
<nil key="highlightedColor"/>
119122
</label>
120123
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Subtitle" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="Iv7-PA-lBt">
121-
<rect key="frame" x="15" y="25.5" width="40.5" height="13.5"/>
124+
<rect key="frame" x="16" y="25.5" width="40.5" height="13.5"/>
122125
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
123126
<fontDescription key="fontDescription" type="system" pointSize="11"/>
124-
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
127+
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
125128
<nil key="highlightedColor"/>
126129
</label>
127130
</subviews>
@@ -146,9 +149,9 @@
146149
<objects>
147150
<tableViewController id="cR6-pa-HhO" customClass="MJSingleViewController" sceneMemberID="viewController">
148151
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" id="sAi-eu-GBh">
149-
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
152+
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
150153
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
151-
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
154+
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
152155
<connections>
153156
<outlet property="dataSource" destination="cR6-pa-HhO" id="HsB-FV-ckP"/>
154157
<outlet property="delegate" destination="cR6-pa-HhO" id="S8o-67-plS"/>
@@ -166,7 +169,6 @@
166169
<navigationController id="X1t-Y8-mVA" sceneMemberID="viewController">
167170
<tabBarItem key="tabBarItem" title="Item" id="Dg6-YQ-9en"/>
168171
<navigationBar key="navigationBar" contentMode="scaleToFill" id="mcw-Hk-IYU">
169-
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
170172
<autoresizingMask key="autoresizingMask"/>
171173
</navigationBar>
172174
<connections>

MJRefreshExample/Classes/First/MJExampleWindow.m

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@ + (void)show
1717
window_ = [[UIWindow alloc] init];
1818
CGFloat width = 150;
1919
CGFloat x = [UIScreen mainScreen].bounds.size.width - width - 10;
20-
window_.frame = CGRectMake(x, 0, width, 25);
20+
CGFloat y = 0;
21+
if ([UIScreen mainScreen].bounds.size.height == 812) {
22+
y = 33;
23+
}
24+
window_.frame = CGRectMake(x, y, width, 25);
2125
window_.windowLevel = UIWindowLevelAlert;
2226
window_.hidden = NO;
2327
window_.alpha = 0.5;
Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1-
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="8191" systemVersion="14F27" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES">
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="13196" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" colorMatched="YES">
3+
<device id="retina4_7" orientation="portrait">
4+
<adaptation id="fullscreen"/>
5+
</device>
36
<dependencies>
4-
<deployment identifier="iOS"/>
5-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8154"/>
7+
<deployment version="1792" identifier="iOS"/>
8+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13173"/>
9+
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
610
</dependencies>
711
<objects>
812
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="MJTestViewController">
@@ -14,7 +18,7 @@
1418
<view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT">
1519
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
1620
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
17-
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
21+
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
1822
</view>
1923
</objects>
2024
</document>
Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1-
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="8191" systemVersion="15B42" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="13196" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
3+
<device id="retina4_7" orientation="portrait">
4+
<adaptation id="fullscreen"/>
5+
</device>
36
<dependencies>
4-
<deployment identifier="iOS"/>
5-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8154"/>
7+
<deployment version="1792" identifier="iOS"/>
8+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13173"/>
9+
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
610
</dependencies>
711
<objects>
812
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="MJWebViewViewController">
@@ -18,38 +22,34 @@
1822
<subviews>
1923
<webView contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="2Of-d4-HFt">
2024
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
21-
<animations/>
22-
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
25+
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
2326
</webView>
2427
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="8xo-5D-MRC">
2528
<rect key="frame" x="241" y="537" width="113" height="30"/>
26-
<animations/>
27-
<color key="backgroundColor" red="1" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
29+
<color key="backgroundColor" red="1" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
2830
<constraints>
2931
<constraint firstAttribute="width" constant="113" id="2YR-NZ-hF1"/>
3032
<constraint firstAttribute="height" constant="30" id="qIc-RV-DwB"/>
3133
</constraints>
3234
<state key="normal" title="回到上一页">
33-
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
35+
<color key="titleShadowColor" red="0.5" green="0.5" blue="0.5" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
3436
</state>
3537
<connections>
3638
<action selector="back" destination="-1" eventType="touchUpInside" id="BG2-eT-gw7"/>
3739
</connections>
3840
</button>
3941
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="注意,这不是原生界面,是个网页:http://weibo.com/excepptions" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="2VR-jQ-Qn4">
4042
<rect key="frame" x="146" y="459" width="208" height="31.5"/>
41-
<animations/>
4243
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.16" colorSpace="custom" customColorSpace="sRGB"/>
4344
<constraints>
4445
<constraint firstAttribute="width" constant="208" id="qkq-G9-eo2"/>
4546
</constraints>
4647
<fontDescription key="fontDescription" type="system" pointSize="13"/>
47-
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
48+
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
4849
<nil key="highlightedColor"/>
4950
</label>
5051
</subviews>
51-
<animations/>
52-
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
52+
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
5353
<constraints>
5454
<constraint firstItem="2Of-d4-HFt" firstAttribute="top" secondItem="i5M-Pr-FkT" secondAttribute="top" id="3LR-sb-d2d"/>
5555
<constraint firstAttribute="bottom" secondItem="8xo-5D-MRC" secondAttribute="bottom" constant="100" id="GEd-8N-H2g"/>
@@ -60,7 +60,6 @@
6060
<constraint firstItem="8xo-5D-MRC" firstAttribute="top" secondItem="2VR-jQ-Qn4" secondAttribute="bottom" constant="46" id="zTm-ax-FFk"/>
6161
<constraint firstItem="2Of-d4-HFt" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" id="zy2-dj-Ccd"/>
6262
</constraints>
63-
<simulatedScreenMetrics key="simulatedDestinationMetrics" type="retina47"/>
6463
</view>
6564
</objects>
6665
</document>

0 commit comments

Comments
 (0)