Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions MVSelectorScrollView.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
65036E56171873AA00DC527A /* MainStoryboard.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 65036E4A171873AA00DC527A /* MainStoryboard.storyboard */; };
65036E57171873AA00DC527A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 65036E4C171873AA00DC527A /* main.m */; };
65036E59171873AA00DC527A /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 65036E50171873AA00DC527A /* ViewController.m */; };
FBBD8DB4197AC9B7002C627A /* scroller_arrow@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = FBBD8DB3197AC9B7002C627A /* scroller_arrow@2x.png */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
Expand Down Expand Up @@ -52,6 +53,7 @@
65036E4E171873AA00DC527A /* MVSelectorScrollView-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "MVSelectorScrollView-Prefix.pch"; sourceTree = "<group>"; };
65036E4F171873AA00DC527A /* ViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = "<group>"; };
65036E50171873AA00DC527A /* ViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = "<group>"; };
FBBD8DB3197AC9B7002C627A /* scroller_arrow@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "scroller_arrow@2x.png"; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -108,6 +110,7 @@
65036E39171872A100DC527A /* MVSelectorScrollView.xib */,
65036E3A171872A100DC527A /* scroller_bg@2x.png */,
65036E3B171872A100DC527A /* scroller_glass@2x.png */,
FBBD8DB3197AC9B7002C627A /* scroller_arrow@2x.png */,
);
path = MVSelectorScrollView;
sourceTree = "<group>";
Expand Down Expand Up @@ -191,6 +194,7 @@
buildActionMask = 2147483647;
files = (
65036E3F171872A100DC527A /* MVSelectorScrollView.xib in Resources */,
FBBD8DB4197AC9B7002C627A /* scroller_arrow@2x.png in Resources */,
65036E40171872A100DC527A /* scroller_bg@2x.png in Resources */,
65036E41171872A100DC527A /* scroller_glass@2x.png in Resources */,
65036E52171873AA00DC527A /* Default-568h@2x.png in Resources */,
Expand Down Expand Up @@ -338,6 +342,7 @@
65036E0C171865E600DC527A /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
Expand Down
5 changes: 5 additions & 0 deletions MVSelectorScrollView/MVSelectorScrollView.m
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ -(id)initWithCoder:(NSCoder *)aDecoder{
if ((self = [super initWithCoder:aDecoder])){
NSArray *views = [[NSBundle mainBundle] loadNibNamed:@"MVSelectorScrollView" owner:self options:nil];
UIView *view = [views objectAtIndex:0];

CGRect frame = view.frame;
frame.size = self.frame.size;
view.frame = frame;

[self addSubview:view];
}
return self;
Expand Down
23 changes: 15 additions & 8 deletions MVSelectorScrollView/MVSelectorScrollView.xib
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.XIB" version="3.0" toolsVersion="5053" systemVersion="13A603" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="5056" systemVersion="14A283o" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
<dependencies>
<deployment defaultVersion="1280" identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3733"/>
Expand All @@ -16,29 +16,35 @@
<rect key="frame" x="0.0" y="0.0" width="300" height="36"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" image="scroller_bg.png" id="3">
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" image="scroller_bg.png" id="3">
<rect key="frame" x="0.0" y="0.0" width="300" height="36"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<rect key="contentStretch" x="0.5" y="0.5" width="0.0" height="0.0"/>
</imageView>
<scrollView multipleTouchEnabled="YES" contentMode="scaleToFill" pagingEnabled="YES" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" id="8">
<rect key="frame" x="113" y="0.0" width="75" height="36"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<connections>
<outlet property="delegate" destination="-1" id="14"/>
</connections>
</scrollView>
<view userInteractionEnabled="NO" contentMode="scaleToFill" id="11" customClass="MVScrollerClipView">
<rect key="frame" x="0.0" y="0.0" width="300" height="36"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<connections>
<outlet property="scrollView" destination="8" id="13"/>
</connections>
</view>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" image="scroller_glass.png" id="9">
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" image="scroller_glass.png" id="9">
<rect key="frame" x="0.0" y="0.0" width="300" height="36"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<rect key="contentStretch" x="0.5" y="0.5" width="0.0" height="0.0"/>
</imageView>
<imageView appearanceType="aqua" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="scroller_arrow.png" id="M85-3I-ai9">
<rect key="frame" x="143" y="0.0" width="14" height="7"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMaxY="YES"/>
</imageView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
Expand All @@ -47,7 +53,8 @@
</view>
</objects>
<resources>
<image name="scroller_bg.png" width="300" height="36"/>
<image name="scroller_glass.png" width="300" height="36"/>
<image name="scroller_arrow.png" width="14" height="7"/>
<image name="scroller_bg.png" width="50" height="36"/>
<image name="scroller_glass.png" width="50" height="36"/>
</resources>
</document>
Binary file added MVSelectorScrollView/scroller_arrow@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified MVSelectorScrollView/scroller_bg@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified MVSelectorScrollView/scroller_glass@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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="5053" systemVersion="13A603" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" initialViewController="2">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="5056" systemVersion="14A283o" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" initialViewController="2">
<dependencies>
<deployment defaultVersion="1280" identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3733"/>
Expand Down Expand Up @@ -64,12 +64,12 @@
</label>
<view contentMode="scaleToFill" id="nww-H9-mvk" customClass="MVSelectorScrollView">
<rect key="frame" x="10" y="134" width="300" height="36"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
</view>
<view tag="1" contentMode="scaleToFill" id="Erg-Eo-YIP" customClass="MVSelectorScrollView">
<rect key="frame" x="10" y="284" width="300" height="36"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
</view>
</subviews>
Expand Down