Skip to content

Commit

Permalink
bug已修复 准备制作Web内容页切换UI
Browse files Browse the repository at this point in the history
  • Loading branch information
zpz1237 committed Oct 7, 2015
1 parent 89f654c commit 8805dd3
Show file tree
Hide file tree
Showing 11 changed files with 88 additions and 40 deletions.
42 changes: 42 additions & 0 deletions Launch Screen.storyboard
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="8191" systemVersion="15B22c" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8154"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="Llm-lL-Icb"/>
<viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="zhihuLaunchImage" translatesAutoresizingMaskIntoConstraints="NO" id="oR7-0X-nEX">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<animations/>
</imageView>
</subviews>
<animations/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="oR7-0X-nEX" firstAttribute="top" secondItem="Ze5-6b-2t3" secondAttribute="top" id="0AM-DJ-oi7"/>
<constraint firstItem="oR7-0X-nEX" firstAttribute="leading" secondItem="Ze5-6b-2t3" secondAttribute="leading" id="Hhh-F6-ghx"/>
<constraint firstItem="oR7-0X-nEX" firstAttribute="bottom" secondItem="xb3-aO-Qok" secondAttribute="top" id="RXh-iN-ZVm"/>
<constraint firstAttribute="trailing" secondItem="oR7-0X-nEX" secondAttribute="trailing" id="Zsm-BT-OOP"/>
</constraints>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
</scene>
</scenes>
<resources>
<image name="zhihuLaunchImage" width="1242" height="2208"/>
</resources>
</document>
2 changes: 1 addition & 1 deletion Pods/Pods.xcodeproj/project.pbxproj

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions zhihuDaily 2.0.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
DBE2B52D1BBCD06400AD5316 /* JSAnimatedImagesView.m in Sources */ = {isa = PBXBuildFile; fileRef = DBE2B52B1BBCD06400AD5316 /* JSAnimatedImagesView.m */; settings = {ASSET_TAGS = (); }; };
DBE2B5331BBCD0D700AD5316 /* MSWeakTimer.m in Sources */ = {isa = PBXBuildFile; fileRef = DBE2B5321BBCD0D700AD5316 /* MSWeakTimer.m */; settings = {ASSET_TAGS = (); }; };
DBE2B5381BBCD27300AD5316 /* LaunchViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DBE2B5371BBCD27300AD5316 /* LaunchViewController.swift */; settings = {ASSET_TAGS = (); }; };
DBE96A5C1BC4CAA60004A591 /* Launch Screen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = DBE96A5B1BC4CAA60004A591 /* Launch Screen.storyboard */; settings = {ASSET_TAGS = (); }; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
Expand Down Expand Up @@ -78,6 +79,7 @@
DBE2B5321BBCD0D700AD5316 /* MSWeakTimer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MSWeakTimer.m; sourceTree = "<group>"; };
DBE2B5341BBCD0FE00AD5316 /* Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Bridging-Header.h"; sourceTree = "<group>"; };
DBE2B5371BBCD27300AD5316 /* LaunchViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LaunchViewController.swift; sourceTree = "<group>"; };
DBE96A5B1BC4CAA60004A591 /* Launch Screen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = "Launch Screen.storyboard"; path = "../Launch Screen.storyboard"; sourceTree = "<group>"; };
EB632050F7B7B84C3E92C5F2 /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */

Expand Down Expand Up @@ -225,6 +227,7 @@
DB1728EE1BC125A300D28822 /* MainTableViewController */,
DBCFB2F41BBE17B600C352C5 /* Assets.xcassets */,
DBC515FA1BBCCC9400EDFF48 /* Main.storyboard */,
DBE96A5B1BC4CAA60004A591 /* Launch Screen.storyboard */,
DBC516021BBCCC9400EDFF48 /* Info.plist */,
DBC9BF101BC2268000B72D69 /* WebViewController.swift */,
);
Expand Down Expand Up @@ -335,6 +338,7 @@
files = (
DBB2FAB81BC3597100AA90FB /* podfile in Resources */,
DBCFB2F51BBE17B600C352C5 /* Assets.xcassets in Resources */,
DBE96A5C1BC4CAA60004A591 /* Launch Screen.storyboard in Resources */,
DBC515FC1BBCCC9400EDFF48 /* Main.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -520,7 +524,6 @@
baseConfigurationReference = 7153B3F99A238DC7B68AE0E4 /* Pods.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
INFOPLIST_FILE = "zhihuDaily 2.0/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "Azure.zhihuDaily-2-0";
Expand All @@ -534,7 +537,6 @@
baseConfigurationReference = EB632050F7B7B84C3E92C5F2 /* Pods.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
INFOPLIST_FILE = "zhihuDaily 2.0/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "Azure.zhihuDaily-2-0";
Expand Down

This file was deleted.

Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "zhihuLaunchImage.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
2 changes: 1 addition & 1 deletion zhihuDaily 2.0/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="8191" systemVersion="15B22c" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="eJm-Aj-C4A">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="8191" systemVersion="15B22c" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="6rh-4x-mHf">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8154"/>
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
Expand Down
6 changes: 3 additions & 3 deletions zhihuDaily 2.0/GradientView.m
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,15 @@ - (void) insertTransparentGradient {

//Transparent Gradient Layer
- (void) insertTwiceTransparentGradient {
UIColor *colorOne = [UIColor colorWithRed:(0/255.0) green:(0/255.0) blue:(0/255.0) alpha:0.36];
UIColor *colorOne = [UIColor colorWithRed:(0/255.0) green:(0/255.0) blue:(0/255.0) alpha:0.70];
UIColor *colorTwo = [UIColor colorWithRed:(0/255.0) green:(0/255.0) blue:(0/255.0) alpha:0.15];
UIColor *colorThree = [UIColor colorWithRed:(0/255.0) green:(0/255.0) blue:(0/255.0) alpha:0.15];
UIColor *colorFour = [UIColor colorWithRed:(0/255.0) green:(0/255.0) blue:(0/255.0) alpha:0.75];
NSArray *colors = [NSArray arrayWithObjects:(id)colorOne.CGColor, colorTwo.CGColor, colorThree.CGColor, colorFour.CGColor, nil];

NSNumber *stopOne = [NSNumber numberWithFloat:0.0];
NSNumber *stopTwo = [NSNumber numberWithFloat:0.06];
NSNumber *stopThree = [NSNumber numberWithFloat:0.48];
NSNumber *stopTwo = [NSNumber numberWithFloat:0.20];
NSNumber *stopThree = [NSNumber numberWithFloat:0.50];
NSNumber *stopFour = [NSNumber numberWithFloat:1.0];
NSArray *locations = [NSArray arrayWithObjects:stopOne, stopTwo, stopThree, stopFour, nil];

Expand Down
12 changes: 7 additions & 5 deletions zhihuDaily 2.0/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
<key>UILaunchStoryboardName</key>
<string>Launch Screen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
Expand All @@ -34,10 +41,5 @@
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
</dict>
</plist>
11 changes: 9 additions & 2 deletions zhihuDaily 2.0/WebViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class WebViewController: UIViewController, UIScrollViewDelegate, ParallaxHeaderV
imageView.addSubview(sourceLabel)

//设置Image上的blurView
blurView = GradientView(frame: CGRectMake(0, -30, self.view.frame.width, orginalHeight + 30), type: TRANSPARENT_GRADIENT_TWICE_TYPE)
blurView = GradientView(frame: CGRectMake(0, -85, self.view.frame.width, orginalHeight + 85), type: TRANSPARENT_GRADIENT_TWICE_TYPE)
imageView.addSubview(blurView)

//使Label不被遮挡
Expand Down Expand Up @@ -111,7 +111,14 @@ class WebViewController: UIViewController, UIScrollViewDelegate, ParallaxHeaderV

//不断添加删除blurView以保证frame正确
blurView.removeFromSuperview()
let tempBlurView = GradientView(frame: CGRectMake(0, -30, self.view.frame.width, orginalHeight + 30 - incrementY), type: TRANSPARENT_GRADIENT_TWICE_TYPE)
let tempBlurView = GradientView(frame: CGRectMake(0, -85 - incrementY, self.view.frame.width, orginalHeight + 85), type: TRANSPARENT_GRADIENT_TWICE_TYPE)
//在blurView上添加"载入上一篇"Label
let refreshLabel = UILabel(frame: CGRectMake(0, 15, self.view.frame.width, 45))
refreshLabel.text = "载入上一篇"
refreshLabel.textAlignment = NSTextAlignment.Center
refreshLabel.textColor = UIColor(red: 215/255.0, green: 215/255.0, blue: 215/255.0, alpha: 1)
refreshLabel.font = UIFont(name: "HelveticaNeue", size: 14)
tempBlurView.addSubview(refreshLabel)
imageView.addSubview(tempBlurView)
blurView = tempBlurView

Expand Down

0 comments on commit 8805dd3

Please sign in to comment.