Skip to content

Commit 4ac85c3

Browse files
author
itjhDev
committed
文章详情上NavBar 向下滑动时顶置
文章详情上NavBar 向下滑动时顶置
1 parent 1114945 commit 4ac85c3

4 files changed

+97
-87
lines changed

itjh_ios/AppDelegate.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
2323
UMSocialData.setAppKey("54238dc5fd98c501b5028d70")
2424
UMSocialSinaHandler.openSSOWithRedirectURL("http://sns.whalecloud.com/sina2/callback")
2525

26-
UINavigationBar.appearance().barTintColor = UIColor(red: 40/255.0, green: 132/255.0, blue: 200/255.0, alpha: 0.3)
26+
UINavigationBar.appearance().barTintColor = UIColor(red: 40/255.0, green: 132/255.0, blue: 200/255.0, alpha: 1)
2727
//UINavigationBar.appearance().barTintColor = UIColorFromRGB(0x028fd6)
2828
UINavigationBar.appearance().tintColor = UIColor.whiteColor()
2929

itjh_ios/ArticlesShowViewController.swift

+3-6
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ class ArticlesShowViewController: UIViewController,UIScrollViewDelegate {
122122

123123
]
124124
atoolbar.setItems(itmes, animated: false)
125-
atoolbar.setBackgroundImage(UIImage(named: "toolbar_bg"), forToolbarPosition: UIBarPosition.Bottom, barMetrics: UIBarMetrics.Default)
125+
126126
}
127127

128128
override func viewDidLoad() {
@@ -132,7 +132,7 @@ class ArticlesShowViewController: UIViewController,UIScrollViewDelegate {
132132
let screenHeight:CGFloat = def.screenHeight()
133133
let screenWidth:CGFloat = def.screenWidth()
134134

135-
// UINavigationBar.appearance().frame = CGRect(x:0.0,y:20.0,width:screenWidth,height:screenHeight-20)
135+
UINavigationBar.appearance().frame = CGRect(x:0.0,y:20.0,width:screenWidth,height:screenHeight-20)
136136

137137
//设置Nav
138138
if iOS7==true {
@@ -190,11 +190,8 @@ class ArticlesShowViewController: UIViewController,UIScrollViewDelegate {
190190
}
191191
}
192192

193-
self.followScrollView(self.awebview)
193+
self.followScrollView(self.awebview, withDelay: 0)
194194
self.awebview.scrollView.delegate = self
195-
196-
197-
198195
}
199196

200197

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="6250" systemVersion="14A389" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="6751" systemVersion="14C109" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
33
<dependencies>
4-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6244"/>
4+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6736"/>
55
</dependencies>
66
<objects>
7-
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="ArticlesShowViewController" customModule="itjh" customModuleProvider="target">
7+
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="ArticlesShowViewController" customModule="itjh_ios" customModuleProvider="target">
88
<connections>
99
<outlet property="atoolbar" destination="ERq-pt-FXB" id="tpC-fS-HOO"/>
1010
<outlet property="awebview" destination="Xr0-sL-h1a" id="4Xe-Og-G6b"/>
@@ -16,26 +16,26 @@
1616
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
1717
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
1818
<subviews>
19+
<webView contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Xr0-sL-h1a">
20+
<rect key="frame" x="0.0" y="0.0" width="600" height="556"/>
21+
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
22+
</webView>
1923
<toolbar opaque="NO" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="ERq-pt-FXB">
2024
<rect key="frame" x="0.0" y="556" width="600" height="44"/>
2125
<items/>
2226
</toolbar>
23-
<webView contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Xr0-sL-h1a">
24-
<rect key="frame" x="0.0" y="60" width="600" height="496"/>
25-
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
26-
</webView>
2727
</subviews>
2828
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
2929
<constraints>
30-
<constraint firstItem="Xr0-sL-h1a" firstAttribute="top" secondItem="i5M-Pr-FkT" secondAttribute="top" constant="60" id="8xq-KT-kbK"/>
30+
<constraint firstItem="Xr0-sL-h1a" firstAttribute="bottom" secondItem="ERq-pt-FXB" secondAttribute="top" id="5e9-Xo-lUv"/>
31+
<constraint firstItem="Xr0-sL-h1a" firstAttribute="top" secondItem="i5M-Pr-FkT" secondAttribute="top" id="8xq-KT-kbK"/>
3132
<constraint firstAttribute="trailing" secondItem="ERq-pt-FXB" secondAttribute="trailing" id="RJg-to-ZUu"/>
3233
<constraint firstItem="Xr0-sL-h1a" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" id="Vla-Tb-UdA"/>
3334
<constraint firstAttribute="bottom" secondItem="ERq-pt-FXB" secondAttribute="bottom" id="Zcu-5H-xrG"/>
34-
<constraint firstItem="Xr0-sL-h1a" firstAttribute="bottom" secondItem="ERq-pt-FXB" secondAttribute="top" id="e1i-Za-osK"/>
3535
<constraint firstItem="ERq-pt-FXB" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" id="ojY-hX-SLH"/>
3636
<constraint firstAttribute="trailing" secondItem="Xr0-sL-h1a" secondAttribute="trailing" id="qLI-PW-Lp6"/>
3737
</constraints>
38-
<point key="canvasLocation" x="486" y="378"/>
38+
<point key="canvasLocation" x="294" y="381"/>
3939
</view>
4040
</objects>
4141
</document>

0 commit comments

Comments
 (0)