new
@@ -8,6 +8,16 @@
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
67DA7495E1DA50AC39223064 /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 505D71422103A38B3602CE9B /* libPods.a */; };
|
||||
A900FCFF1C07F9C6007B2E40 /* jiankantijian@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = A900FCFC1C07F9C6007B2E40 /* jiankantijian@3x.png */; };
|
||||
A900FD001C07F9C6007B2E40 /* yiliaoxuqiu@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = A900FCFD1C07F9C6007B2E40 /* yiliaoxuqiu@3x.png */; };
|
||||
A900FD011C07F9C6007B2E40 /* yuyuezixun@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = A900FCFE1C07F9C6007B2E40 /* yuyuezixun@3x.png */; };
|
||||
A900FD051C07F9EE007B2E40 /* jiankantijian@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A900FD021C07F9EE007B2E40 /* jiankantijian@2x.png */; };
|
||||
A900FD061C07F9EE007B2E40 /* yiliaoxuqiu@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A900FD031C07F9EE007B2E40 /* yiliaoxuqiu@2x.png */; };
|
||||
A900FD071C07F9EE007B2E40 /* yuyuezixun@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A900FD041C07F9EE007B2E40 /* yuyuezixun@2x.png */; };
|
||||
A900FD0B1C07FEBC007B2E40 /* MyTopView.m in Sources */ = {isa = PBXBuildFile; fileRef = A900FD0A1C07FEBC007B2E40 /* MyTopView.m */; };
|
||||
A900FD0D1C07FF88007B2E40 /* MyTopView.xib in Resources */ = {isa = PBXBuildFile; fileRef = A900FD0C1C07FF88007B2E40 /* MyTopView.xib */; };
|
||||
A900FD0F1C080066007B2E40 /* avatar@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A900FD0E1C080066007B2E40 /* avatar@2x.png */; };
|
||||
A900FD111C080072007B2E40 /* avatar@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = A900FD101C080072007B2E40 /* avatar@3x.png */; };
|
||||
A9841F231C04357C00FB72AA /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = A9841F221C04357C00FB72AA /* main.m */; };
|
||||
A9841F261C04357C00FB72AA /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = A9841F251C04357C00FB72AA /* AppDelegate.m */; };
|
||||
A9841F291C04357C00FB72AA /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A9841F281C04357C00FB72AA /* ViewController.m */; };
|
||||
@@ -48,12 +58,26 @@
|
||||
A986A3A51C04CE1800B55F38 /* Ash_UIUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = A986A3A01C04CE1800B55F38 /* Ash_UIUtil.m */; };
|
||||
A986A3A61C04CE1800B55F38 /* CommonUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = A986A3A21C04CE1800B55F38 /* CommonUtil.m */; };
|
||||
A986A3A71C04CE1800B55F38 /* UIImageView+Reloading.m in Sources */ = {isa = PBXBuildFile; fileRef = A986A3A41C04CE1800B55F38 /* UIImageView+Reloading.m */; };
|
||||
A986A3AB1C04D30000B55F38 /* YKuImageInLoopScrollView.m in Sources */ = {isa = PBXBuildFile; fileRef = A986A3AA1C04D30000B55F38 /* YKuImageInLoopScrollView.m */; };
|
||||
A986A3AD1C04D63600B55F38 /* bannerbg@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A986A3AC1C04D63600B55F38 /* bannerbg@2x.png */; };
|
||||
A986A3AF1C04D64B00B55F38 /* bannerbg@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = A986A3AE1C04D64B00B55F38 /* bannerbg@3x.png */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
039B3B8DE609FF96BF1F8983 /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
1FF024B7A433F169D4A7C1DB /* 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>"; };
|
||||
505D71422103A38B3602CE9B /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
A900FCFC1C07F9C6007B2E40 /* jiankantijian@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "jiankantijian@3x.png"; sourceTree = "<group>"; };
|
||||
A900FCFD1C07F9C6007B2E40 /* yiliaoxuqiu@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "yiliaoxuqiu@3x.png"; sourceTree = "<group>"; };
|
||||
A900FCFE1C07F9C6007B2E40 /* yuyuezixun@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "yuyuezixun@3x.png"; sourceTree = "<group>"; };
|
||||
A900FD021C07F9EE007B2E40 /* jiankantijian@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "jiankantijian@2x.png"; sourceTree = "<group>"; };
|
||||
A900FD031C07F9EE007B2E40 /* yiliaoxuqiu@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "yiliaoxuqiu@2x.png"; sourceTree = "<group>"; };
|
||||
A900FD041C07F9EE007B2E40 /* yuyuezixun@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "yuyuezixun@2x.png"; sourceTree = "<group>"; };
|
||||
A900FD091C07FEBC007B2E40 /* MyTopView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MyTopView.h; sourceTree = "<group>"; };
|
||||
A900FD0A1C07FEBC007B2E40 /* MyTopView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MyTopView.m; sourceTree = "<group>"; };
|
||||
A900FD0C1C07FF88007B2E40 /* MyTopView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MyTopView.xib; sourceTree = "<group>"; };
|
||||
A900FD0E1C080066007B2E40 /* avatar@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "avatar@2x.png"; sourceTree = "<group>"; };
|
||||
A900FD101C080072007B2E40 /* avatar@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "avatar@3x.png"; sourceTree = "<group>"; };
|
||||
A9841F1E1C04357C00FB72AA /* Doctor.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Doctor.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
A9841F221C04357C00FB72AA /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
|
||||
A9841F241C04357C00FB72AA /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
|
||||
@@ -118,6 +142,10 @@
|
||||
A986A3A21C04CE1800B55F38 /* CommonUtil.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CommonUtil.m; sourceTree = "<group>"; };
|
||||
A986A3A31C04CE1800B55F38 /* UIImageView+Reloading.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIImageView+Reloading.h"; sourceTree = "<group>"; };
|
||||
A986A3A41C04CE1800B55F38 /* UIImageView+Reloading.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIImageView+Reloading.m"; sourceTree = "<group>"; };
|
||||
A986A3A91C04D30000B55F38 /* YKuImageInLoopScrollView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = YKuImageInLoopScrollView.h; sourceTree = "<group>"; };
|
||||
A986A3AA1C04D30000B55F38 /* YKuImageInLoopScrollView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = YKuImageInLoopScrollView.m; sourceTree = "<group>"; };
|
||||
A986A3AC1C04D63600B55F38 /* bannerbg@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "bannerbg@2x.png"; sourceTree = "<group>"; };
|
||||
A986A3AE1C04D64B00B55F38 /* bannerbg@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "bannerbg@3x.png"; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
@@ -140,6 +168,16 @@
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
A900FD081C07FE9D007B2E40 /* My */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
A900FD091C07FEBC007B2E40 /* MyTopView.h */,
|
||||
A900FD0A1C07FEBC007B2E40 /* MyTopView.m */,
|
||||
A900FD0C1C07FF88007B2E40 /* MyTopView.xib */,
|
||||
);
|
||||
name = My;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
A9841F151C04357C00FB72AA = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -210,6 +248,16 @@
|
||||
A986A3311C04C4DC00B55F38 /* Resource */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
A900FD101C080072007B2E40 /* avatar@3x.png */,
|
||||
A900FD0E1C080066007B2E40 /* avatar@2x.png */,
|
||||
A900FCFC1C07F9C6007B2E40 /* jiankantijian@3x.png */,
|
||||
A900FCFD1C07F9C6007B2E40 /* yiliaoxuqiu@3x.png */,
|
||||
A900FCFE1C07F9C6007B2E40 /* yuyuezixun@3x.png */,
|
||||
A986A3AC1C04D63600B55F38 /* bannerbg@2x.png */,
|
||||
A986A3AE1C04D64B00B55F38 /* bannerbg@3x.png */,
|
||||
A900FD021C07F9EE007B2E40 /* jiankantijian@2x.png */,
|
||||
A900FD031C07F9EE007B2E40 /* yiliaoxuqiu@2x.png */,
|
||||
A900FD041C07F9EE007B2E40 /* yuyuezixun@2x.png */,
|
||||
A986A39A1C04CD9A00B55F38 /* myed@2x.png */,
|
||||
A986A39B1C04CD9A00B55F38 /* myno@2x.png */,
|
||||
A986A3961C04CD7500B55F38 /* myno@3x.png */,
|
||||
@@ -229,6 +277,7 @@
|
||||
A986A3441C04C4DC00B55F38 /* Util */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
A986A3A81C04D30000B55F38 /* YKuLoopScrollView */,
|
||||
A986A39E1C04CE1800B55F38 /* Tool */,
|
||||
A986A3451C04C4DC00B55F38 /* AWordDefault.h */,
|
||||
A986A3461C04C4DC00B55F38 /* AWordDefault.m */,
|
||||
@@ -249,6 +298,7 @@
|
||||
A986A34A1C04C4DC00B55F38 /* View */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
A900FD081C07FE9D007B2E40 /* My */,
|
||||
A986A3791C04C7F700B55F38 /* Main */,
|
||||
A986A34B1C04C4DC00B55F38 /* LoginViewController.h */,
|
||||
A986A34C1C04C4DC00B55F38 /* LoginViewController.m */,
|
||||
@@ -316,6 +366,15 @@
|
||||
path = Tool;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
A986A3A81C04D30000B55F38 /* YKuLoopScrollView */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
A986A3A91C04D30000B55F38 /* YKuImageInLoopScrollView.h */,
|
||||
A986A3AA1C04D30000B55F38 /* YKuImageInLoopScrollView.m */,
|
||||
);
|
||||
path = YKuLoopScrollView;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
EE0E51118CD397393147ABC3 /* Pods */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -386,19 +445,30 @@
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
A986A3991C04CD7500B55F38 /* myed@3x.png in Resources */,
|
||||
A900FCFF1C07F9C6007B2E40 /* jiankantijian@3x.png in Resources */,
|
||||
A900FD001C07F9C6007B2E40 /* yiliaoxuqiu@3x.png in Resources */,
|
||||
A986A36E1C04C4DC00B55F38 /* LoginViewController.xib in Resources */,
|
||||
A986A3761C04C59400B55F38 /* Default.png in Resources */,
|
||||
A986A3811C04C9E600B55F38 /* ServiceViewController.xib in Resources */,
|
||||
A900FD011C07F9C6007B2E40 /* yuyuezixun@3x.png in Resources */,
|
||||
A986A38B1C04CA4200B55F38 /* NavigateViewController.xib in Resources */,
|
||||
A9841F311C04357C00FB72AA /* LaunchScreen.storyboard in Resources */,
|
||||
A900FD0F1C080066007B2E40 /* avatar@2x.png in Resources */,
|
||||
A986A3921C04CC6700B55F38 /* seriviced@3x.png in Resources */,
|
||||
A9841F2E1C04357C00FB72AA /* Assets.xcassets in Resources */,
|
||||
A986A3951C04CCDC00B55F38 /* Default@3x.png in Resources */,
|
||||
A986A38F1C04CC5D00B55F38 /* serivicedno@2x.png in Resources */,
|
||||
A986A3751C04C59400B55F38 /* Default-568h@2x.png in Resources */,
|
||||
A900FD061C07F9EE007B2E40 /* yiliaoxuqiu@2x.png in Resources */,
|
||||
A986A3AD1C04D63600B55F38 /* bannerbg@2x.png in Resources */,
|
||||
A986A3AF1C04D64B00B55F38 /* bannerbg@3x.png in Resources */,
|
||||
A900FD111C080072007B2E40 /* avatar@3x.png in Resources */,
|
||||
A986A3771C04C59400B55F38 /* Default@2x.png in Resources */,
|
||||
A9841F2C1C04357C00FB72AA /* Main.storyboard in Resources */,
|
||||
A900FD051C07F9EE007B2E40 /* jiankantijian@2x.png in Resources */,
|
||||
A986A39C1C04CD9A00B55F38 /* myed@2x.png in Resources */,
|
||||
A900FD071C07F9EE007B2E40 /* yuyuezixun@2x.png in Resources */,
|
||||
A900FD0D1C07FF88007B2E40 /* MyTopView.xib in Resources */,
|
||||
A986A3981C04CD7500B55F38 /* myno@3x.png in Resources */,
|
||||
A986A39D1C04CD9A00B55F38 /* myno@2x.png in Resources */,
|
||||
A986A3861C04C9F400B55F38 /* MyViewController.xib in Resources */,
|
||||
@@ -466,6 +536,7 @@
|
||||
A986A38A1C04CA4200B55F38 /* NavigateViewController.m in Sources */,
|
||||
A986A3551C04C4DC00B55F38 /* BaseModel.m in Sources */,
|
||||
A986A3801C04C9E600B55F38 /* ServiceViewController.m in Sources */,
|
||||
A986A3AB1C04D30000B55F38 /* YKuImageInLoopScrollView.m in Sources */,
|
||||
A986A3571C04C4DC00B55F38 /* LoginModel.m in Sources */,
|
||||
A9841F291C04357C00FB72AA /* ViewController.m in Sources */,
|
||||
A986A3701C04C4DC00B55F38 /* LoginViewModel.m in Sources */,
|
||||
@@ -481,6 +552,7 @@
|
||||
A986A3A51C04CE1800B55F38 /* Ash_UIUtil.m in Sources */,
|
||||
A986A3531C04C4DC00B55F38 /* BaseAPIClient.m in Sources */,
|
||||
A986A37C1C04C84800B55F38 /* MainTabBarViewController.m in Sources */,
|
||||
A900FD0B1C07FEBC007B2E40 /* MyTopView.m in Sources */,
|
||||
A9841F231C04357C00FB72AA /* main.m in Sources */,
|
||||
A986A3561C04C4DC00B55F38 /* BaseWLService.m in Sources */,
|
||||
);
|
||||
|
||||
@@ -0,0 +1,343 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Bucket
|
||||
type = "0"
|
||||
version = "2.0">
|
||||
<Breakpoints>
|
||||
<BreakpointProxy
|
||||
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
||||
<BreakpointContent
|
||||
shouldBeEnabled = "No"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
filePath = "Doctor/View/ServiceViewController.m"
|
||||
timestampString = "470081326.449883"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "53"
|
||||
endingLineNumber = "53"
|
||||
landmarkName = "-numOfPageForScrollView:"
|
||||
landmarkType = "5">
|
||||
</BreakpointContent>
|
||||
</BreakpointProxy>
|
||||
<BreakpointProxy
|
||||
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
||||
<BreakpointContent
|
||||
shouldBeEnabled = "No"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
filePath = "Doctor/View/ServiceViewController.m"
|
||||
timestampString = "470081326.449883"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "64"
|
||||
endingLineNumber = "64"
|
||||
landmarkName = "-scrollView:viewAtPageIndex:"
|
||||
landmarkType = "5">
|
||||
</BreakpointContent>
|
||||
</BreakpointProxy>
|
||||
<BreakpointProxy
|
||||
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
||||
<BreakpointContent
|
||||
shouldBeEnabled = "No"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
filePath = "Doctor/View/ServiceViewController.m"
|
||||
timestampString = "470079253.696532"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "23"
|
||||
endingLineNumber = "23"
|
||||
landmarkName = "-viewDidLoad"
|
||||
landmarkType = "5">
|
||||
</BreakpointContent>
|
||||
</BreakpointProxy>
|
||||
<BreakpointProxy
|
||||
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
||||
<BreakpointContent
|
||||
shouldBeEnabled = "No"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
filePath = "Doctor/View/ServiceViewController.m"
|
||||
timestampString = "470081326.449883"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "58"
|
||||
endingLineNumber = "58"
|
||||
landmarkName = "-widthForScrollView:"
|
||||
landmarkType = "5">
|
||||
</BreakpointContent>
|
||||
</BreakpointProxy>
|
||||
<BreakpointProxy
|
||||
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
||||
<BreakpointContent
|
||||
shouldBeEnabled = "No"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
filePath = "Doctor/Util/YKuLoopScrollView/YKuImageInLoopScrollView.m"
|
||||
timestampString = "470080942.771741"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "410"
|
||||
endingLineNumber = "410"
|
||||
landmarkName = "-scrollViewWillBeginDecelerating:"
|
||||
landmarkType = "5">
|
||||
</BreakpointContent>
|
||||
</BreakpointProxy>
|
||||
<BreakpointProxy
|
||||
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
||||
<BreakpointContent
|
||||
shouldBeEnabled = "No"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
filePath = "Doctor/Util/YKuLoopScrollView/YKuImageInLoopScrollView.m"
|
||||
timestampString = "470080942.771741"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "162"
|
||||
endingLineNumber = "162"
|
||||
landmarkName = "-setAbsolutePageIndex:animated:setContentOffset:"
|
||||
landmarkType = "5">
|
||||
</BreakpointContent>
|
||||
</BreakpointProxy>
|
||||
<BreakpointProxy
|
||||
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
||||
<BreakpointContent
|
||||
shouldBeEnabled = "Yes"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
filePath = "Doctor/View/ServiceViewController.m"
|
||||
timestampString = "470081326.449883"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "67"
|
||||
endingLineNumber = "67"
|
||||
landmarkName = "-scrollView:viewAtPageIndex:"
|
||||
landmarkType = "5">
|
||||
</BreakpointContent>
|
||||
</BreakpointProxy>
|
||||
<BreakpointProxy
|
||||
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
||||
<BreakpointContent
|
||||
shouldBeEnabled = "No"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
filePath = "Doctor/Util/YKuLoopScrollView/YKuImageInLoopScrollView.m"
|
||||
timestampString = "470080942.771741"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "191"
|
||||
endingLineNumber = "191"
|
||||
landmarkName = "-setAbsolutePageIndex:"
|
||||
landmarkType = "5">
|
||||
</BreakpointContent>
|
||||
</BreakpointProxy>
|
||||
<BreakpointProxy
|
||||
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
||||
<BreakpointContent
|
||||
shouldBeEnabled = "No"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
filePath = "Doctor/Util/YKuLoopScrollView/YKuImageInLoopScrollView.m"
|
||||
timestampString = "470080942.771741"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "189"
|
||||
endingLineNumber = "189"
|
||||
landmarkName = "-setAbsolutePageIndex:"
|
||||
landmarkType = "5">
|
||||
</BreakpointContent>
|
||||
</BreakpointProxy>
|
||||
<BreakpointProxy
|
||||
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
||||
<BreakpointContent
|
||||
shouldBeEnabled = "No"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
filePath = "Doctor/Util/YKuLoopScrollView/YKuImageInLoopScrollView.m"
|
||||
timestampString = "470080942.771741"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "190"
|
||||
endingLineNumber = "190"
|
||||
landmarkName = "-setAbsolutePageIndex:"
|
||||
landmarkType = "5">
|
||||
</BreakpointContent>
|
||||
</BreakpointProxy>
|
||||
<BreakpointProxy
|
||||
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
||||
<BreakpointContent
|
||||
shouldBeEnabled = "No"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
filePath = "Doctor/Util/YKuLoopScrollView/YKuImageInLoopScrollView.m"
|
||||
timestampString = "470080942.771741"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "186"
|
||||
endingLineNumber = "186"
|
||||
landmarkName = "-setAbsolutePageIndex:animated:"
|
||||
landmarkType = "5">
|
||||
</BreakpointContent>
|
||||
</BreakpointProxy>
|
||||
<BreakpointProxy
|
||||
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
||||
<BreakpointContent
|
||||
shouldBeEnabled = "No"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
filePath = "Doctor/Util/YKuLoopScrollView/YKuImageInLoopScrollView.m"
|
||||
timestampString = "470080942.771741"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "102"
|
||||
endingLineNumber = "102"
|
||||
landmarkName = "-layoutPage:"
|
||||
landmarkType = "5">
|
||||
</BreakpointContent>
|
||||
</BreakpointProxy>
|
||||
<BreakpointProxy
|
||||
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
||||
<BreakpointContent
|
||||
shouldBeEnabled = "Yes"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
filePath = "Doctor/Util/YKuLoopScrollView/YKuImageInLoopScrollView.m"
|
||||
timestampString = "470080711.90996"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "44"
|
||||
endingLineNumber = "44"
|
||||
landmarkName = "-viewAtIndex:"
|
||||
landmarkType = "5">
|
||||
</BreakpointContent>
|
||||
</BreakpointProxy>
|
||||
<BreakpointProxy
|
||||
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
||||
<BreakpointContent
|
||||
shouldBeEnabled = "Yes"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
filePath = "Doctor/Util/YKuLoopScrollView/YKuImageInLoopScrollView.m"
|
||||
timestampString = "470080942.771741"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "78"
|
||||
endingLineNumber = "78"
|
||||
landmarkName = "-viewAtIndex:"
|
||||
landmarkType = "5">
|
||||
</BreakpointContent>
|
||||
</BreakpointProxy>
|
||||
<BreakpointProxy
|
||||
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
||||
<BreakpointContent
|
||||
shouldBeEnabled = "Yes"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
filePath = "Doctor/Util/YKuLoopScrollView/YKuImageInLoopScrollView.m"
|
||||
timestampString = "470080942.771741"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "80"
|
||||
endingLineNumber = "80"
|
||||
landmarkName = "-viewAtIndex:"
|
||||
landmarkType = "5">
|
||||
</BreakpointContent>
|
||||
</BreakpointProxy>
|
||||
<BreakpointProxy
|
||||
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
||||
<BreakpointContent
|
||||
shouldBeEnabled = "Yes"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
filePath = "Doctor/Util/YKuLoopScrollView/YKuImageInLoopScrollView.m"
|
||||
timestampString = "470081005.453476"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "133"
|
||||
endingLineNumber = "133"
|
||||
landmarkName = "-layoutPage:"
|
||||
landmarkType = "5">
|
||||
</BreakpointContent>
|
||||
</BreakpointProxy>
|
||||
<BreakpointProxy
|
||||
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
||||
<BreakpointContent
|
||||
shouldBeEnabled = "Yes"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
filePath = "Doctor/Util/YKuLoopScrollView/YKuImageInLoopScrollView.m"
|
||||
timestampString = "470081011.339481"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "135"
|
||||
endingLineNumber = "135"
|
||||
landmarkName = "-layoutPage:"
|
||||
landmarkType = "5">
|
||||
</BreakpointContent>
|
||||
</BreakpointProxy>
|
||||
<BreakpointProxy
|
||||
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
||||
<BreakpointContent
|
||||
shouldBeEnabled = "Yes"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
filePath = "Doctor/Util/YKuLoopScrollView/YKuImageInLoopScrollView.m"
|
||||
timestampString = "470081012.459395"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "134"
|
||||
endingLineNumber = "134"
|
||||
landmarkName = "-layoutPage:"
|
||||
landmarkType = "5">
|
||||
</BreakpointContent>
|
||||
</BreakpointProxy>
|
||||
<BreakpointProxy
|
||||
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
||||
<BreakpointContent
|
||||
shouldBeEnabled = "Yes"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
filePath = "Doctor/Util/YKuLoopScrollView/YKuImageInLoopScrollView.m"
|
||||
timestampString = "470081054.570333"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "171"
|
||||
endingLineNumber = "171"
|
||||
landmarkName = "-setAbsolutePageIndex:animated:setContentOffset:"
|
||||
landmarkType = "5">
|
||||
</BreakpointContent>
|
||||
</BreakpointProxy>
|
||||
<BreakpointProxy
|
||||
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
||||
<BreakpointContent
|
||||
shouldBeEnabled = "Yes"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
filePath = "Doctor/Util/YKuLoopScrollView/YKuImageInLoopScrollView.m"
|
||||
timestampString = "470081067.616274"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "175"
|
||||
endingLineNumber = "175"
|
||||
landmarkName = "-setAbsolutePageIndex:animated:setContentOffset:"
|
||||
landmarkType = "5">
|
||||
</BreakpointContent>
|
||||
</BreakpointProxy>
|
||||
<BreakpointProxy
|
||||
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
||||
<BreakpointContent
|
||||
shouldBeEnabled = "Yes"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
filePath = "Doctor/Util/YKuLoopScrollView/YKuImageInLoopScrollView.m"
|
||||
timestampString = "470081079.963867"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "183"
|
||||
endingLineNumber = "183"
|
||||
landmarkName = "-setAbsolutePageIndex:animated:setContentOffset:"
|
||||
landmarkType = "5">
|
||||
</BreakpointContent>
|
||||
</BreakpointProxy>
|
||||
</Breakpoints>
|
||||
</Bucket>
|
||||
@@ -19,6 +19,7 @@
|
||||
// Override point for customization after application launch.
|
||||
_mainViewController = [[MainTabBarViewController alloc] init];
|
||||
self.window.rootViewController = _mainViewController;
|
||||
_mainViewController.selectedIndex = 1;
|
||||
_mainViewController.delegate = self;
|
||||
|
||||
return YES;
|
||||
|
||||
@@ -21,4 +21,6 @@
|
||||
#import "MBProgressHUD+Util.h"
|
||||
#import "Ash_UIUtil.h"
|
||||
#import "CommonUtil.h"
|
||||
#import <SDWebImage/UIImageView+WebCache.h>
|
||||
#import <SDWebImage/UIButton+WebCache.h>
|
||||
#endif /* PrefixHeader_pch */
|
||||
|
||||
|
After Width: | Height: | Size: 6.5 KiB |
|
After Width: | Height: | Size: 8.5 KiB |
|
After Width: | Height: | Size: 412 KiB |
|
After Width: | Height: | Size: 995 KiB |
|
After Width: | Height: | Size: 8.3 KiB |
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 8.0 KiB |
|
After Width: | Height: | Size: 8.8 KiB |
|
After Width: | Height: | Size: 8.9 KiB |
|
After Width: | Height: | Size: 8.3 KiB |
@@ -479,7 +479,7 @@
|
||||
|
||||
+ (UIColor *)appMainColorAlpha:(CGFloat)alpha
|
||||
{
|
||||
return [UIColor colorWithHexString:@"#61BFA9" alpha:1];
|
||||
return [UIColor colorWithHexString:@"#61BFA9" alpha:alpha];
|
||||
}
|
||||
|
||||
+ (UIColor *)appNavBackgroundColor
|
||||
|
||||
@@ -0,0 +1,240 @@
|
||||
//
|
||||
// YKuImageInLoopScrollView.h
|
||||
// YKuAGP
|
||||
//
|
||||
// Created by DengBin on 13-12-31.
|
||||
// Copyright (c) 2013年 YeKuMob.com. All rights reserved.
|
||||
//
|
||||
/*
|
||||
实现了中间的image的宽度可以小于view的宽度
|
||||
有一个问题,滚动的动画打断后会停在当前位置
|
||||
在SrollView中增加内置的PageControll
|
||||
可显示6种样式和自定义图片,可配置位置
|
||||
*/
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@class StyledPageControl;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
ScrollViewDefault = 0,
|
||||
ScrollViewLoop,
|
||||
|
||||
}ScrollViewType; // ScrollView显示类型
|
||||
|
||||
typedef enum
|
||||
{
|
||||
PageControlStyleDefault = 0,
|
||||
PageControlStyleStrokedCircle = 1,
|
||||
PageControlStylePressed1 = 2,
|
||||
PageControlStylePressed2 = 3,
|
||||
PageControlStyleWithPageNumber = 4,
|
||||
PageControlStyleThumb = 5, // 可设置图片
|
||||
PageControlStyleStrokedSquare = 6,
|
||||
PageControlStyleSquareRect = 7,
|
||||
} PageControlStyle; // pageControll显示类型
|
||||
|
||||
typedef enum
|
||||
{
|
||||
PageControlSiteLeft = 0,
|
||||
PageControlSiteMiddle = 1,
|
||||
PageControlSiteRight = 2,
|
||||
} PageControlSite; // pageControll显示位置
|
||||
|
||||
@protocol YKuImageInLoopScrollViewDelegate;
|
||||
|
||||
/*
|
||||
横向循环滚动的图片 paging scrollview ,需要在delegate 中 实现,,主要作用是嵌入在scrollview 中比YKSlideView 更自然
|
||||
usage:
|
||||
implement delegate ,not add view to self
|
||||
@remark:
|
||||
构建一个超大contentsize 的scrollview,把需要的子view 铺在可视范围周边
|
||||
*/
|
||||
@interface YKuImageInLoopScrollView : UIView<UIScrollViewDelegate>{
|
||||
@private
|
||||
int m_absolutePageIndex; // 当前第几页
|
||||
int numOfPage; // 总共有多少页
|
||||
float oldOffsetX; // 滑动时记录ScrollView的横坐标
|
||||
BOOL skipSetContentOffset; // 跳过处理setcontentOffset 事件
|
||||
UIScrollView *contentScrollView;
|
||||
NSMutableDictionary *addSubViewDictionary; // 本类自动添加的子试图,key为pageindex (NSNumber) value 为view
|
||||
CGSize sizeOfPage; // ScrollView的大小
|
||||
NSDate *startDate; // scroll 开始时间
|
||||
NSDate *endDate; // scroll 结束时间 用开始和结束时间差小于0.2秒来响应快速且scroll距离小于一半的size.width
|
||||
NSTimer *repeatTimer; // 自动轮播的定时器
|
||||
|
||||
|
||||
}
|
||||
@property(nonatomic,assign) id<YKuImageInLoopScrollViewDelegate> delegate;
|
||||
|
||||
/**
|
||||
* ScrollView的显示类型
|
||||
* 默认为ScrollViewDefault(常规ScrollView)
|
||||
* 设置为ScrollViewLoop 周边留白
|
||||
*/
|
||||
@property(nonatomic,assign) ScrollViewType scrollViewType;
|
||||
/**
|
||||
* ScrollView内置的PageView
|
||||
*/
|
||||
@property(nonatomic,strong) StyledPageControl *styledPageControl;
|
||||
|
||||
|
||||
@property (nonatomic, assign) NSTimeInterval repeatInterval; //自动轮播时间
|
||||
|
||||
/**
|
||||
* 初始化方法
|
||||
* style pagecontrol样式 参考枚举PageControlStyle
|
||||
* position 参考枚举PageControlSite
|
||||
* gap 点间距
|
||||
* selectedColor 选中后的颜色
|
||||
*/
|
||||
- (id)initWithFrame:(CGRect)frame
|
||||
pageControlStyle:(PageControlStyle) style
|
||||
position:(PageControlSite) position
|
||||
gapWidth:(int) gap
|
||||
selectedColor:(UIColor *) color;
|
||||
|
||||
-(void)stop;
|
||||
|
||||
/**
|
||||
* 重新加载
|
||||
*/
|
||||
-(void) reloadData;
|
||||
|
||||
/**
|
||||
* 下一张图片
|
||||
*
|
||||
* @param anim 是否需要动画
|
||||
*/
|
||||
- (void) nextPage:(BOOL)anim;
|
||||
|
||||
/**
|
||||
* 设置pageindex [0-delegate.numOfPageForScrollView];
|
||||
*
|
||||
* @param index 图片索引
|
||||
* @param anim 是否需要动画
|
||||
*/
|
||||
- (void)setPageIndex:(int)index animated:(BOOL)anim;
|
||||
|
||||
/**
|
||||
* 获取当前的索引号
|
||||
*
|
||||
* @return 当前的索引号
|
||||
*/
|
||||
- (int)pageIndex;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@protocol YKuImageInLoopScrollViewDelegate <NSObject>
|
||||
|
||||
/*
|
||||
总共有多少页
|
||||
*/
|
||||
- (int) numOfPageForScrollView:(YKuImageInLoopScrollView*)ascrollView;
|
||||
|
||||
/*
|
||||
显示在中间的view的width
|
||||
*/
|
||||
- (int) widthForScrollView:(YKuImageInLoopScrollView*)ascrollView;
|
||||
|
||||
/*
|
||||
第apageIndex 页的图片网址, view会被设置为新的frame
|
||||
@param viewAtPageIndex:[0- viewAtPageIndex];
|
||||
*/
|
||||
- (UIView*)scrollView:(YKuImageInLoopScrollView*)ascrollView viewAtPageIndex:(int)apageIndex;
|
||||
|
||||
@optional
|
||||
- (void)scrollView:(YKuImageInLoopScrollView*)ascrollView didTapIndex:(int)apageIndex;
|
||||
|
||||
@optional
|
||||
/*
|
||||
选中第几页
|
||||
@param didSelectedPageIndex 选中的第几项,[0-numOfPageForScrollView];
|
||||
*/
|
||||
- (void) scrollView:(YKuImageInLoopScrollView*) ascrollView didSelectedPageIndex:(int)apageIndex;
|
||||
|
||||
/*
|
||||
开始滚动
|
||||
*/
|
||||
- (void)scrollViewWillBeginDecelerating:(YKuImageInLoopScrollView*)ascrollView;
|
||||
|
||||
/*
|
||||
结束滚动
|
||||
*/
|
||||
- (void)scrollViewDidEndDecelerating:(YKuImageInLoopScrollView*)ascrollView;
|
||||
|
||||
|
||||
@end
|
||||
|
||||
|
||||
|
||||
|
||||
@protocol YKuImageInLoopScrollViewInternalDelegate <UIScrollViewDelegate>
|
||||
|
||||
-(void) onSetContentOffset:(CGPoint)contentOffset;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@interface YKuImageInLoopScrollViewInternal : UIScrollView {
|
||||
@private
|
||||
|
||||
}
|
||||
@end
|
||||
|
||||
@interface StyledPageControl : UIControl
|
||||
@property (nonatomic, assign ) PageControlStyle pageControlStyle; // 显示类型
|
||||
@property (nonatomic, assign ) PageControlSite pageControlSite; // 显示位置(左中右)
|
||||
@property (nonatomic, strong ) UIColor *coreNormalColor; // 未选中内心(某些类型未用)
|
||||
@property (nonatomic, strong ) UIColor *coreSelectedColor; // 选中下内心
|
||||
@property (nonatomic, strong ) UIColor *strokeNormalColor; // 未选中外框
|
||||
@property (nonatomic, strong ) UIColor *strokeSelectedColor; // 选中下外框
|
||||
@property (nonatomic, strong ) UIImage *thumbImage; // 未选中的图片
|
||||
@property (nonatomic, strong ) UIImage *selectedThumbImage; // 选中下的图片
|
||||
@property (nonatomic, strong ) NSMutableDictionary *thumbImageForIndex; // 各个位置未选中的图片字典
|
||||
@property (nonatomic, strong ) NSMutableDictionary *selectedThumbImageForIndex;// 各个位置选中下的图片字典
|
||||
@property (nonatomic, assign ) BOOL hidesForSinglePage; // 单个点是否隐藏
|
||||
@property (nonatomic, assign ) int currentPage; // 当前页码
|
||||
@property (nonatomic, assign ) int numberOfPages; // 页码总数
|
||||
@property (nonatomic, assign ) int strokeWidth; // 外圈的宽度(宽度包括在直径里面)
|
||||
@property (nonatomic, assign ) int gapWidth; // 两个点之间的距离
|
||||
@property (nonatomic, assign ) int diameter; // 点的直径(包括外圈宽度)
|
||||
@property (nonatomic, assign ) float bottomDistance; // 距离底部的距离
|
||||
|
||||
|
||||
/**
|
||||
* 单个设置PageControll在相应位置上的默认图片
|
||||
*
|
||||
* @param aThumbImage:需要设置的图片
|
||||
* @param index:位置索引号
|
||||
*/
|
||||
- (void)setThumbImage:(UIImage *)aThumbImage forIndex:(NSInteger)index;
|
||||
|
||||
/**
|
||||
* 获取PageControll在相应位置上的默认图片
|
||||
*
|
||||
* @param index:位置索引号
|
||||
* @return
|
||||
*/
|
||||
- (UIImage *)thumbImageForIndex:(NSInteger)index;
|
||||
|
||||
/**
|
||||
* 单个设置PageControll在被选中的相应位置上的的图片
|
||||
*
|
||||
* @param aSelectedThumbImage:需要设置的图片
|
||||
* @param index:位置索引号
|
||||
*/
|
||||
- (void)setSelectedThumbImage:(UIImage *)aSelectedThumbImage forIndex:(NSInteger)index;
|
||||
|
||||
/**
|
||||
* 获取PageControll在相应位置上的选中图片
|
||||
*
|
||||
* @param index:位置索引号
|
||||
* @return
|
||||
*/
|
||||
- (UIImage *)selectedThumbImageForIndex:(NSInteger)index;
|
||||
|
||||
@end
|
||||
|
||||
@@ -0,0 +1,934 @@
|
||||
//
|
||||
// YKuImageInLoopScrollView.m
|
||||
// YKuAGP
|
||||
//
|
||||
// Created by DengBin on 13-12-31.
|
||||
// Copyright (c) 2013年 YeKuMob.com. All rights reserved.
|
||||
//
|
||||
|
||||
#import "YKuImageInLoopScrollView.h"
|
||||
|
||||
#define COLOR_GRAYISHBLUE [UIColor colorWithRed:128/255.0 green:130/255.0 blue:133/255.0 alpha:1]
|
||||
#define COLOR_GRAY [UIColor colorWithRed:0.2 green:0.2 blue:0.2 alpha:1]
|
||||
|
||||
#define PageControllDiameter 8 // 默认PageControll的点的直径
|
||||
#define PageControllGapWidth 4 // 默认PageControll两个点之间的缝隙距离
|
||||
#define PageControllBottomDistance 10 // 默认PageControll距离底部的距离
|
||||
#define PageControllStrokeWidth 2 // 默认PageControll的点外圈宽度
|
||||
|
||||
|
||||
static const int maxRange_smallLoopScrollViewX =1000; //
|
||||
|
||||
@interface YKuImageInLoopScrollView()
|
||||
|
||||
/*
|
||||
设置绝对pageindex [0-2000]; [1000]==0
|
||||
*/
|
||||
- (void)setAbsolutePageIndex:(int)index animated:(BOOL)anim;
|
||||
- (int)absolutePageIndex;
|
||||
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@implementation YKuImageInLoopScrollView
|
||||
@synthesize delegate;
|
||||
|
||||
|
||||
/*
|
||||
返回aindex的view
|
||||
@param aindex : 第几个view,arrayindex ,可能为负
|
||||
*/
|
||||
- (UIView*)viewAtIndex:(int)arrayindex
|
||||
{
|
||||
UIView *ret = nil;
|
||||
// ScrollViewLoop
|
||||
if ( self.scrollViewType == ScrollViewLoop )
|
||||
{
|
||||
ret = [[UIView alloc]initWithFrame:CGRectMake(0, 0,
|
||||
[self.delegate widthForScrollView:self],
|
||||
self.frame.size.height)];
|
||||
[ret setBackgroundColor:[UIColor whiteColor]];
|
||||
|
||||
//id<YKuImageInLoopScrollViewDelegate> adelegate = (id<YKuImageInLoopScrollViewDelegate>) self.delegate;
|
||||
UIView *oneView = [self.delegate scrollView:self viewAtPageIndex:arrayindex]; //需要处理超大负值
|
||||
[ret addSubview:oneView];
|
||||
[oneView setCenter:ret.center];
|
||||
|
||||
// 添加点击图片事件
|
||||
UIControl *retControl = [[UIControl alloc]initWithFrame:oneView.frame];
|
||||
[retControl setBackgroundColor:[UIColor clearColor]];
|
||||
retControl.tag = arrayindex;
|
||||
[retControl addTarget:self action:@selector(didTapIndex:) forControlEvents:UIControlEventTouchUpInside];
|
||||
[ret addSubview:retControl];
|
||||
[oneView setCenter:ret.center];
|
||||
|
||||
assert( ret != nil );
|
||||
}
|
||||
// 普通的SrollView
|
||||
else
|
||||
{
|
||||
ret = [[UIView alloc]initWithFrame:CGRectMake(0, 0,
|
||||
self.frame.size.width,
|
||||
self.frame.size.height)];
|
||||
[ret setBackgroundColor:[UIColor whiteColor]];
|
||||
|
||||
// id<YKuImageInLoopScrollViewDelegate> adelegate = (id<YKuImageInLoopScrollViewDelegate>) self.delegate;
|
||||
UIView *oneView = [self.delegate scrollView:self viewAtPageIndex:arrayindex]; //需要处理超大负值
|
||||
[oneView setFrame:ret.frame];
|
||||
CGRect frame1 = ret.frame;
|
||||
[ret addSubview:oneView];
|
||||
|
||||
// 添加点击图片事件
|
||||
UIControl *retControl = [[UIControl alloc]initWithFrame:oneView.frame];
|
||||
[retControl setBackgroundColor:[UIColor clearColor]];
|
||||
retControl.tag = arrayindex;
|
||||
[retControl addTarget:self action:@selector(didTapIndex:) forControlEvents:UIControlEventTouchUpInside];
|
||||
[ret addSubview:retControl];
|
||||
[oneView setCenter:ret.center];
|
||||
|
||||
assert( ret != nil );
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* 绘制整个ScrollView
|
||||
*
|
||||
* @param centerIndex 索引号
|
||||
*/
|
||||
- (void)layoutPage:(int)centerIndex{
|
||||
sizeOfPage=self.frame.size;
|
||||
|
||||
// 如果是ScrollViewLoop则调用代理,否则宽度大小即为ScrollView的大小
|
||||
if ( self.scrollViewType == ScrollViewLoop ) {
|
||||
sizeOfPage.width = [self.delegate widthForScrollView:self];
|
||||
}
|
||||
else{
|
||||
sizeOfPage.width = self.frame.size.width;
|
||||
}
|
||||
// 当前图片两边的留白(其他图片)的宽度
|
||||
int cha = self.frame.size.width-sizeOfPage.width;
|
||||
cha/=2;
|
||||
|
||||
contentScrollView.scrollEnabled = numOfPage > 1;
|
||||
|
||||
if( numOfPage > 0 ){
|
||||
const int range=2;
|
||||
NSMutableDictionary* newdic=[[NSMutableDictionary alloc] init]; //生成新的view
|
||||
for( int i=centerIndex-range; i<centerIndex+range; ++i ){
|
||||
// 当前页码
|
||||
int atArrayIndex=((i-maxRange_smallLoopScrollViewX)%numOfPage+numOfPage)%numOfPage;
|
||||
NSNumber* key=[NSNumber numberWithInt:atArrayIndex];
|
||||
// 当前视图
|
||||
UIView* v=[addSubViewDictionary objectForKey:key];
|
||||
|
||||
// 设置当前页面的图片视图
|
||||
if( v==nil || [[newdic allKeys] containsObject:key] ){
|
||||
v=[self viewAtIndex:atArrayIndex];
|
||||
}
|
||||
assert(v!=nil);
|
||||
// 设置当前图片视图的位置
|
||||
CGRect frame=CGRectMake(i*sizeOfPage.width+cha, 0, sizeOfPage.width, sizeOfPage.height);
|
||||
v.frame=frame;
|
||||
[contentScrollView addSubview:v];
|
||||
|
||||
if( [[newdic allKeys] containsObject:key] ){ //当数量很少时会有闪动
|
||||
[newdic setObject:v forKey:[NSNumber numberWithInt:i]];
|
||||
}else{
|
||||
[newdic setObject:v forKey:key];
|
||||
}
|
||||
}
|
||||
for( UIView *v in [addSubViewDictionary allValues] ){
|
||||
if( ![[newdic allValues] containsObject:v] ){
|
||||
[v removeFromSuperview];
|
||||
}
|
||||
}
|
||||
[addSubViewDictionary removeAllObjects];
|
||||
[addSubViewDictionary addEntriesFromDictionary:newdic];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置当前页码
|
||||
*
|
||||
* @param index 索引号
|
||||
* @param anim 是否动画
|
||||
* @param set <#set description#>
|
||||
*/
|
||||
- (void)setAbsolutePageIndex:(int)index animated:(BOOL)anim setContentOffset:(BOOL)set{
|
||||
//YKuLog(@"%s index=%d",__FUNCTION__,index);
|
||||
if( index == m_absolutePageIndex || numOfPage < 1 ){
|
||||
return;
|
||||
}
|
||||
if( index+1 >= 2*maxRange_smallLoopScrollViewX || index-1 <= 0 ){
|
||||
index = maxRange_smallLoopScrollViewX+((index-maxRange_smallLoopScrollViewX)%numOfPage+numOfPage)%numOfPage;
|
||||
set=YES;
|
||||
}
|
||||
[self layoutPage:index];
|
||||
m_absolutePageIndex=index;
|
||||
contentScrollView.contentSize=CGSizeMake(sizeOfPage.width*maxRange_smallLoopScrollViewX*2, sizeOfPage.height);
|
||||
if(set){
|
||||
float x=index*sizeOfPage.width;
|
||||
[contentScrollView setContentOffset:CGPointMake(x, 0) animated:anim];
|
||||
// YKuLog(@"contentScrollView=%@",contentScrollView);
|
||||
}else{
|
||||
//setContenOffset 后会引起page change
|
||||
if([delegate respondsToSelector:@selector(scrollView:didSelectedPageIndex:)]){
|
||||
[self.styledPageControl setCurrentPage:[self pageIndex]];
|
||||
[delegate scrollView:self didSelectedPageIndex:[self pageIndex]];
|
||||
}
|
||||
}
|
||||
// YKuLog(@" contentScrollView=%@",contentScrollView);
|
||||
}
|
||||
-(void)setAbsolutePageIndex:(int)index animated:(BOOL) anim{
|
||||
[self setAbsolutePageIndex:index animated:anim setContentOffset:YES];
|
||||
}
|
||||
|
||||
-(void)setAbsolutePageIndex:(int)index {
|
||||
[self setAbsolutePageIndex:index animated:NO];
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回当前页码
|
||||
* @return 当前页码
|
||||
*/
|
||||
-(int)absolutePageIndex{
|
||||
return m_absolutePageIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* 跳转指定页
|
||||
* @param index 索引号
|
||||
* @param anim 是否动画
|
||||
*/
|
||||
-(void)setPageIndex:(int)index animated:(BOOL) anim{
|
||||
assert(index>=0 && index<numOfPage );
|
||||
int absindex= maxRange_smallLoopScrollViewX+index;
|
||||
[self setAbsolutePageIndex:absindex animated:anim];
|
||||
}
|
||||
|
||||
-(int) pageIndex{
|
||||
return ((m_absolutePageIndex-maxRange_smallLoopScrollViewX)%numOfPage+numOfPage)%numOfPage;
|
||||
}
|
||||
|
||||
-(void)nextPage:(BOOL)anim{
|
||||
int currentindex=m_absolutePageIndex+1;
|
||||
[self setAbsolutePageIndex:currentindex animated:anim];
|
||||
}
|
||||
|
||||
-(void)timerFired:(NSTimer *)timer{
|
||||
[self nextPage:[timer.userInfo boolValue]];
|
||||
}
|
||||
|
||||
/**
|
||||
* 刷新数据
|
||||
*/
|
||||
-(void) reloadData{
|
||||
// id<YKuImageInLoopScrollViewDelegate> adelegate=(id<YKuImageInLoopScrollViewDelegate>) self.delegate;
|
||||
// 总页数
|
||||
int num=[self.delegate numOfPageForScrollView:self];
|
||||
assert(num>=0);
|
||||
numOfPage=num;
|
||||
|
||||
m_absolutePageIndex=-1;
|
||||
for(NSNumber* key in [addSubViewDictionary allKeys]){
|
||||
UIView* v=[addSubViewDictionary objectForKey:key];
|
||||
[v removeFromSuperview];
|
||||
}
|
||||
[addSubViewDictionary removeAllObjects];
|
||||
if(num>0){
|
||||
[self setAbsolutePageIndex:maxRange_smallLoopScrollViewX];
|
||||
}
|
||||
|
||||
int offsetY = - 10;
|
||||
// 根据图片数量设置PageControl
|
||||
self.styledPageControl.numberOfPages = num;
|
||||
[self.styledPageControl setFrame:CGRectMake(0, 0,
|
||||
self.styledPageControl.diameter*num + (num-1)*self.styledPageControl.gapWidth,
|
||||
self.styledPageControl.diameter)];
|
||||
// 设置pageControlSite的位置
|
||||
switch ( self.styledPageControl.pageControlSite ){
|
||||
case PageControlSiteLeft:{
|
||||
[self.styledPageControl setFrame:CGRectMake(
|
||||
0,
|
||||
self.frame.size.height - self.styledPageControl.diameter - self.styledPageControl.bottomDistance+offsetY,
|
||||
self.styledPageControl.diameter*num + (num-1)*self.styledPageControl.gapWidth,
|
||||
self.styledPageControl.diameter)];
|
||||
}
|
||||
break;
|
||||
case PageControlSiteMiddle:{
|
||||
[self.styledPageControl setFrame:CGRectMake(
|
||||
self.center.x - self.styledPageControl.frame.size.width/2,
|
||||
self.frame.size.height - self.styledPageControl.diameter - self.styledPageControl.bottomDistance+offsetY,
|
||||
self.styledPageControl.diameter*num + (num-1)*self.styledPageControl.gapWidth,
|
||||
self.styledPageControl.diameter)];
|
||||
}
|
||||
break;
|
||||
case PageControlSiteRight:{
|
||||
[self.styledPageControl setFrame:CGRectMake(
|
||||
self.frame.size.width - self.styledPageControl.frame.size.width+offsetY,
|
||||
self.frame.size.height - self.styledPageControl.diameter - self.styledPageControl.bottomDistance,
|
||||
self.styledPageControl.diameter*num+(num-1) * self.styledPageControl.gapWidth,
|
||||
self.styledPageControl.diameter)];
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
[self addSubview:self.styledPageControl];
|
||||
if (self.styledPageControl.numberOfPages < 2)
|
||||
{
|
||||
self.styledPageControl.hidden = YES;
|
||||
}
|
||||
else
|
||||
{
|
||||
self.styledPageControl.hidden = NO;
|
||||
}
|
||||
if (repeatTimer.isValid == NO && self.styledPageControl.numberOfPages >= 2)
|
||||
{
|
||||
repeatTimer = [NSTimer scheduledTimerWithTimeInterval:3 target:self selector:@selector(timerFired:) userInfo:@YES repeats:YES];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 轮播图点击事件
|
||||
* @param sender 根据轮播图中的Tag判断点击的位置
|
||||
*/
|
||||
- (void)didTapIndex:(id)sender{
|
||||
|
||||
// id<YKuImageInLoopScrollViewDelegate> adelegate=(id<YKuImageInLoopScrollViewDelegate>) self.delegate;
|
||||
int num=[self.delegate numOfPageForScrollView:self];
|
||||
if (num==0) {
|
||||
return;
|
||||
}
|
||||
[self.delegate scrollView:self didTapIndex:(int)((UIControl *)sender).tag];
|
||||
}
|
||||
|
||||
-(void)setRepeatInterval:(NSTimeInterval)repeatInterval
|
||||
{
|
||||
_repeatInterval = repeatInterval;
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化
|
||||
*/
|
||||
-(void) internalInit{
|
||||
self.styledPageControl = [[StyledPageControl alloc]init];
|
||||
addSubViewDictionary=[[NSMutableDictionary alloc] init];
|
||||
contentScrollView=[[YKuImageInLoopScrollViewInternal alloc] initWithFrame:self.bounds];
|
||||
contentScrollView.delegate=self;
|
||||
contentScrollView.scrollsToTop = NO;
|
||||
contentScrollView.pagingEnabled=NO;
|
||||
contentScrollView.autoresizingMask=UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
|
||||
contentScrollView.showsVerticalScrollIndicator=NO;
|
||||
contentScrollView.showsHorizontalScrollIndicator=NO;
|
||||
[self addSubview:contentScrollView];
|
||||
[self reloadData];
|
||||
|
||||
|
||||
}
|
||||
|
||||
- (id)initWithCoder:(NSCoder *)aDecoder{
|
||||
self=[super initWithCoder:aDecoder];
|
||||
if(self){
|
||||
[self internalInit];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化方法
|
||||
* style pagecontrol样式 参考枚举PageControlStyle
|
||||
* position 参考枚举PageControlSite
|
||||
* gap 点间距
|
||||
* selectedColor 选中后的颜色
|
||||
*/
|
||||
|
||||
- (id)initWithFrame:(CGRect)frame
|
||||
pageControlStyle:(PageControlStyle) style
|
||||
position:(PageControlSite) position
|
||||
gapWidth:(int) gap
|
||||
selectedColor:(UIColor *) color
|
||||
{
|
||||
self=[super initWithFrame:frame];
|
||||
if(self)
|
||||
{
|
||||
[self internalInit];
|
||||
[self.styledPageControl setPageControlStyle:style];
|
||||
[self.styledPageControl setPageControlSite:position];
|
||||
[self.styledPageControl setGapWidth:gap];
|
||||
[self.styledPageControl setCoreSelectedColor:color];
|
||||
[self.styledPageControl setCoreNormalColor:[UIColor colorWithHexString:@"#ffffff" alpha:.4f]];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
-(void)stop
|
||||
{
|
||||
for(NSNumber* key in [addSubViewDictionary allKeys])
|
||||
{
|
||||
UIView* v=[addSubViewDictionary objectForKey:key];
|
||||
[v removeFromSuperview];
|
||||
}
|
||||
if (repeatTimer)
|
||||
{
|
||||
[repeatTimer invalidate];
|
||||
repeatTimer = nil;
|
||||
}
|
||||
}
|
||||
|
||||
-(void)dealloc
|
||||
{
|
||||
for(NSNumber* key in [addSubViewDictionary allKeys])
|
||||
{
|
||||
UIView* v=[addSubViewDictionary objectForKey:key];
|
||||
[v removeFromSuperview];
|
||||
}
|
||||
if ( repeatTimer )
|
||||
[repeatTimer invalidate];
|
||||
repeatTimer = nil;
|
||||
}
|
||||
|
||||
/**
|
||||
* 开始拖动
|
||||
*/
|
||||
- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView{
|
||||
|
||||
// 暂停定时器
|
||||
if ( [repeatTimer isValid] ) [repeatTimer invalidate];
|
||||
oldOffsetX = scrollView.contentOffset.x;
|
||||
startDate = [[NSDate date] copy];
|
||||
}
|
||||
|
||||
/**
|
||||
* 跳转到下一张
|
||||
*/
|
||||
-(void)scrollViewWillBeginDecelerating:(UIScrollView *)scrollView{
|
||||
|
||||
CGPoint pOff = scrollView.contentOffset;
|
||||
|
||||
float currentX = pOff.x;
|
||||
float cha = currentX-oldOffsetX;
|
||||
endDate = [[NSDate date] copy];
|
||||
NSTimeInterval inter = [endDate timeIntervalSinceDate:startDate];
|
||||
if (inter<0.2) {
|
||||
if (cha<0) {
|
||||
pOff.x = ((int)(oldOffsetX/sizeOfPage.width)-1)*sizeOfPage.width;
|
||||
}else{
|
||||
pOff.x = ((int)(oldOffsetX/sizeOfPage.width)+1)*sizeOfPage.width;
|
||||
}
|
||||
}else{
|
||||
|
||||
if (abs(cha)<sizeOfPage.width/2) {
|
||||
pOff.x = ((int)(oldOffsetX/sizeOfPage.width))*sizeOfPage.width;
|
||||
}else{
|
||||
if (cha<0||cha==0) {
|
||||
pOff.x = ((int)(oldOffsetX/sizeOfPage.width)-1)*sizeOfPage.width;
|
||||
}else{
|
||||
pOff.x = ((int)(oldOffsetX/sizeOfPage.width)+1)*sizeOfPage.width;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
[scrollView setContentOffset:pOff animated:YES];
|
||||
if([delegate respondsToSelector:@selector(scrollViewWillBeginDecelerating:)]){
|
||||
[delegate scrollViewWillBeginDecelerating:self];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 停止拖动,将要减速,不一定跳到下一张
|
||||
*/
|
||||
- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate{
|
||||
|
||||
if (repeatTimer.isValid == NO && self.styledPageControl.numberOfPages >= 2)
|
||||
{
|
||||
repeatTimer = [NSTimer scheduledTimerWithTimeInterval:3 target:self selector:@selector(timerFired:) userInfo:@YES repeats:YES];
|
||||
}
|
||||
|
||||
if (!decelerate) {
|
||||
CGPoint pOff = scrollView.contentOffset;
|
||||
|
||||
float currentX = pOff.x;
|
||||
float cha = currentX-oldOffsetX;
|
||||
if (abs(cha)<sizeOfPage.width/2) {
|
||||
pOff.x = ((int)(oldOffsetX/sizeOfPage.width))*sizeOfPage.width;
|
||||
}else{
|
||||
if (cha<0||cha==0) {
|
||||
pOff.x = ((int)(oldOffsetX/sizeOfPage.width)-1)*sizeOfPage.width;
|
||||
}else{
|
||||
pOff.x = ((int)(oldOffsetX/sizeOfPage.width)+1)*sizeOfPage.width;
|
||||
}
|
||||
|
||||
}
|
||||
[scrollView setContentOffset:pOff animated:YES];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
-(void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView{
|
||||
//在当前位置左右都铺上subview
|
||||
if([delegate respondsToSelector:@selector(scrollViewDidEndDecelerating:)])
|
||||
{
|
||||
[delegate scrollViewDidEndDecelerating:self];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
-(void) onSetContentOffset:(CGPoint)contentOffset{
|
||||
//YKuLog(@"%s contentOffset=%@",__FUNCTION__,NSStringFromCGPoint(contentOffset));
|
||||
if(skipSetContentOffset){
|
||||
skipSetContentOffset=NO;
|
||||
return;
|
||||
}
|
||||
int currentindex=round(contentOffset.x/sizeOfPage.width);
|
||||
if(currentindex+1>=2*maxRange_smallLoopScrollViewX || currentindex-1<=0){
|
||||
skipSetContentOffset=YES;
|
||||
[self setAbsolutePageIndex:currentindex animated:NO setContentOffset:YES];
|
||||
}else{
|
||||
[self setAbsolutePageIndex:currentindex animated:NO setContentOffset:NO];
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@implementation YKuImageInLoopScrollViewInternal
|
||||
|
||||
-(void)setContentOffset:(CGPoint)contentOffset
|
||||
{
|
||||
[super setContentOffset:contentOffset];
|
||||
if([self.delegate respondsToSelector:@selector(onSetContentOffset:)]){
|
||||
[(id<YKuImageInLoopScrollViewInternalDelegate>)self.delegate onSetContentOffset:contentOffset];
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation StyledPageControl
|
||||
- (id)initWithFrame:(CGRect)frame
|
||||
{
|
||||
self = [super initWithFrame:frame];
|
||||
if (self)
|
||||
{
|
||||
[self setup];
|
||||
|
||||
}
|
||||
return self;
|
||||
}
|
||||
- (id)initWithCoder:(NSCoder *)aDecoder
|
||||
{
|
||||
self=[super initWithCoder:aDecoder];
|
||||
if (self)
|
||||
{
|
||||
[self setup];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
-(void)setup
|
||||
{
|
||||
[self setBackgroundColor:[UIColor clearColor]];
|
||||
|
||||
self.pageControlStyle = PageControlStyleDefault;
|
||||
self.bottomDistance = PageControllBottomDistance;
|
||||
self.strokeWidth = PageControllStrokeWidth;
|
||||
self.gapWidth = PageControllGapWidth;
|
||||
self.diameter = PageControllDiameter;
|
||||
|
||||
// 切换下一张手势
|
||||
// UITapGestureRecognizer *tapGestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(onTapped:)];
|
||||
// [self addGestureRecognizer:tapGestureRecognizer];
|
||||
}
|
||||
|
||||
/**
|
||||
* 点击原点事件,切换下一张(上一张)
|
||||
*
|
||||
* @param gesture 手势
|
||||
*/
|
||||
- (void)onTapped:(UITapGestureRecognizer*)gesture
|
||||
{
|
||||
CGPoint touchPoint = [gesture locationInView:[gesture view]];
|
||||
|
||||
if (touchPoint.x < self.frame.size.width/2)
|
||||
{
|
||||
// move left
|
||||
if (self.currentPage>0)
|
||||
{
|
||||
if (touchPoint.x <= 22)
|
||||
{
|
||||
self.currentPage = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
self.currentPage -= 1;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
// move right
|
||||
if (self.currentPage<self.numberOfPages-1)
|
||||
{
|
||||
if (touchPoint.x >= (CGRectGetWidth(self.bounds) - 22))
|
||||
{
|
||||
self.currentPage = self.numberOfPages-1;
|
||||
}
|
||||
else
|
||||
{
|
||||
self.currentPage += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
[self setNeedsDisplay];
|
||||
[self sendActionsForControlEvents:UIControlEventValueChanged];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 重新绘画各中类型的PageControll,系统自己调用
|
||||
*
|
||||
* @param rect
|
||||
*/
|
||||
- (void)drawRect:(CGRect)rect
|
||||
{
|
||||
UIColor *coreNormalColor, *coreSelectedColor, *strokeNormalColor, *strokeSelectedColor;
|
||||
|
||||
if (self.coreNormalColor)
|
||||
{
|
||||
coreNormalColor = self.coreNormalColor;
|
||||
}
|
||||
else
|
||||
{
|
||||
coreNormalColor = COLOR_GRAYISHBLUE;
|
||||
}
|
||||
|
||||
if (self.coreSelectedColor)
|
||||
{
|
||||
coreSelectedColor = self.coreSelectedColor;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (self.pageControlStyle==PageControlStyleStrokedSquare ||
|
||||
self.pageControlStyle==PageControlStyleStrokedCircle ||
|
||||
self.pageControlStyle==PageControlStyleWithPageNumber)
|
||||
{
|
||||
coreSelectedColor = COLOR_GRAYISHBLUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
coreSelectedColor = COLOR_GRAY;
|
||||
}
|
||||
}
|
||||
|
||||
if (self.strokeNormalColor)
|
||||
{
|
||||
strokeNormalColor = self.strokeNormalColor;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (self.pageControlStyle==PageControlStyleDefault && self.coreNormalColor)
|
||||
{
|
||||
strokeNormalColor = self.coreNormalColor;
|
||||
}
|
||||
else
|
||||
{
|
||||
strokeNormalColor = COLOR_GRAYISHBLUE;
|
||||
}
|
||||
|
||||
}
|
||||
// 如果有设定选中颜色
|
||||
if (self.strokeSelectedColor)
|
||||
{
|
||||
strokeSelectedColor = self.strokeSelectedColor;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (self.pageControlStyle==PageControlStyleStrokedSquare || self.pageControlStyle==PageControlStyleStrokedCircle || self.pageControlStyle==PageControlStyleWithPageNumber)
|
||||
{
|
||||
strokeSelectedColor = COLOR_GRAYISHBLUE;
|
||||
}
|
||||
else if (self.pageControlStyle==PageControlStyleDefault && self.coreSelectedColor)
|
||||
{
|
||||
strokeSelectedColor = self.coreSelectedColor;
|
||||
}
|
||||
|
||||
else if (self.pageControlStyle == PageControlStyleSquareRect)
|
||||
{
|
||||
strokeNormalColor = [UIColor clearColor];
|
||||
strokeSelectedColor = [UIColor clearColor];
|
||||
}
|
||||
else
|
||||
{
|
||||
strokeSelectedColor = COLOR_GRAY;
|
||||
}
|
||||
}
|
||||
|
||||
// Drawing code
|
||||
if (self.hidesForSinglePage && self.numberOfPages==1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
CGContextRef myContext = UIGraphicsGetCurrentContext();
|
||||
|
||||
// 两个点之间的距离
|
||||
int gap = self.gapWidth;
|
||||
// 内心的直径
|
||||
float diameter = self.diameter - 2*self.strokeWidth;
|
||||
|
||||
if (self.pageControlStyle==PageControlStyleThumb)
|
||||
{
|
||||
if (self.thumbImage && self.selectedThumbImage)
|
||||
{
|
||||
diameter = self.thumbImage.size.width;
|
||||
}
|
||||
}
|
||||
|
||||
int total_width = self.numberOfPages*diameter + (self.numberOfPages-1)*gap;
|
||||
|
||||
// 如果设置的总宽度大于pageControll的宽度,则调整直径diameter大小
|
||||
if (total_width>self.frame.size.width)
|
||||
{
|
||||
while (total_width>self.frame.size.width)
|
||||
{
|
||||
diameter -= 2;
|
||||
gap = diameter + 2;
|
||||
while (total_width>self.frame.size.width)
|
||||
{
|
||||
gap -= 1;
|
||||
total_width = self.numberOfPages*diameter + (self.numberOfPages-1)*gap;
|
||||
|
||||
if (gap==2)
|
||||
{
|
||||
break;
|
||||
total_width = self.numberOfPages*diameter + (self.numberOfPages-1)*gap;
|
||||
}
|
||||
}
|
||||
|
||||
if (diameter==2)
|
||||
{
|
||||
break;
|
||||
total_width = self.numberOfPages*diameter + (self.numberOfPages-1)*gap;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int i;
|
||||
for (i=0; i<self.numberOfPages; i++)
|
||||
{
|
||||
int x = (self.frame.size.width-total_width)/2 + i*(diameter+gap);
|
||||
|
||||
if (self.pageControlStyle==PageControlStyleDefault)
|
||||
{
|
||||
if (i==self.currentPage)
|
||||
{
|
||||
CGContextSetFillColorWithColor(myContext, [coreSelectedColor CGColor]);
|
||||
CGContextFillEllipseInRect(myContext, CGRectMake(x,(self.frame.size.height-diameter)/2,diameter,diameter));
|
||||
CGContextSetStrokeColorWithColor(myContext, [strokeSelectedColor CGColor]);
|
||||
CGContextStrokeEllipseInRect(myContext, CGRectMake(x,(self.frame.size.height-diameter)/2,diameter,diameter));
|
||||
}
|
||||
else
|
||||
{
|
||||
CGContextSetFillColorWithColor(myContext, [coreNormalColor CGColor]);
|
||||
CGContextFillEllipseInRect(myContext, CGRectMake(x,(self.frame.size.height-diameter)/2,diameter,diameter));
|
||||
CGContextSetStrokeColorWithColor(myContext, [strokeNormalColor CGColor]);
|
||||
CGContextStrokeEllipseInRect(myContext, CGRectMake(x,(self.frame.size.height-diameter)/2,diameter,diameter));
|
||||
}
|
||||
}
|
||||
#warning 实心方形的绘制方法,added by 张闽
|
||||
else if (self.pageControlStyle == PageControlStyleSquareRect)
|
||||
{
|
||||
if (i == self.currentPage)
|
||||
{
|
||||
CGContextSetFillColorWithColor(myContext, [coreSelectedColor CGColor]);
|
||||
CGContextFillRect(myContext, CGRectMake(x,(self.frame.size.height-diameter)/2,diameter,diameter));
|
||||
CGContextSetStrokeColorWithColor(myContext, [strokeSelectedColor CGColor]);
|
||||
CGContextStrokeRect(myContext, CGRectMake(x,(self.frame.size.height-diameter)/2,diameter,diameter));
|
||||
}
|
||||
else
|
||||
{
|
||||
CGContextSetFillColorWithColor(myContext, [coreNormalColor CGColor]);
|
||||
CGContextFillRect(myContext, CGRectMake(x,(self.frame.size.height-diameter)/2,diameter,diameter));
|
||||
CGContextSetStrokeColorWithColor(myContext, [strokeNormalColor CGColor]);
|
||||
CGContextStrokeRect(myContext, CGRectMake(x,(self.frame.size.height-diameter)/2,diameter,diameter));
|
||||
}
|
||||
}
|
||||
else if (self.pageControlStyle==PageControlStyleStrokedSquare)
|
||||
{
|
||||
CGContextSetLineWidth(myContext, self.strokeWidth);
|
||||
if (i==self.currentPage)
|
||||
{
|
||||
CGContextSetFillColorWithColor(myContext, [coreSelectedColor CGColor]);
|
||||
CGContextFillRect(myContext, CGRectMake(x,(self.frame.size.height-diameter)/2,diameter,diameter));
|
||||
CGContextSetStrokeColorWithColor(myContext, [strokeSelectedColor CGColor]);
|
||||
CGContextStrokeRect(myContext, CGRectMake(x,(self.frame.size.height-diameter)/2,diameter,diameter));
|
||||
}
|
||||
else
|
||||
{
|
||||
CGContextSetStrokeColorWithColor(myContext, [strokeNormalColor CGColor]);
|
||||
CGContextStrokeRect(myContext, CGRectMake(x,(self.frame.size.height-diameter)/2,diameter,diameter));
|
||||
}
|
||||
}
|
||||
else if (self.pageControlStyle==PageControlStyleStrokedCircle)
|
||||
{
|
||||
CGContextSetLineWidth(myContext, self.strokeWidth);
|
||||
if (i==self.currentPage)
|
||||
{
|
||||
CGContextSetFillColorWithColor(myContext, [coreSelectedColor CGColor]);
|
||||
CGContextFillEllipseInRect(myContext, CGRectMake(x,(self.frame.size.height-diameter)/2,diameter,diameter));
|
||||
CGContextSetStrokeColorWithColor(myContext, [strokeSelectedColor CGColor]);
|
||||
CGContextStrokeEllipseInRect(myContext, CGRectMake(x,(self.frame.size.height-diameter)/2,diameter,diameter));
|
||||
}
|
||||
else
|
||||
{
|
||||
CGContextSetStrokeColorWithColor(myContext, [strokeNormalColor CGColor]);
|
||||
CGContextStrokeEllipseInRect(myContext, CGRectMake(x,(self.frame.size.height-diameter)/2,diameter,diameter));
|
||||
}
|
||||
}
|
||||
else if (self.pageControlStyle==PageControlStyleWithPageNumber)
|
||||
{
|
||||
CGContextSetLineWidth(myContext, self.strokeWidth);
|
||||
if (i==self.currentPage)
|
||||
{
|
||||
int _currentPageDiameter = diameter*1.6;
|
||||
x = (self.frame.size.width-total_width)/2 + i*(diameter+gap) - (_currentPageDiameter-diameter)/2;
|
||||
CGContextSetFillColorWithColor(myContext, [coreSelectedColor CGColor]);
|
||||
CGContextFillEllipseInRect(myContext, CGRectMake(x,(self.frame.size.height-_currentPageDiameter)/2,_currentPageDiameter,_currentPageDiameter));
|
||||
CGContextSetStrokeColorWithColor(myContext, [strokeSelectedColor CGColor]);
|
||||
CGContextStrokeEllipseInRect(myContext, CGRectMake(x,(self.frame.size.height-_currentPageDiameter)/2,_currentPageDiameter,_currentPageDiameter));
|
||||
|
||||
NSString *pageNumber = [NSString stringWithFormat:@"%i", i+1];
|
||||
CGContextSetFillColorWithColor(myContext, [[UIColor whiteColor] CGColor]);
|
||||
[pageNumber drawInRect:CGRectMake(x,(self.frame.size.height-_currentPageDiameter)/2-1,_currentPageDiameter,_currentPageDiameter)
|
||||
withFont:[UIFont systemFontOfSize:_currentPageDiameter-2]
|
||||
lineBreakMode:NSLineBreakByCharWrapping
|
||||
alignment:NSTextAlignmentCenter];
|
||||
}
|
||||
else
|
||||
{
|
||||
CGContextSetStrokeColorWithColor(myContext, [strokeNormalColor CGColor]);
|
||||
CGContextStrokeEllipseInRect(myContext, CGRectMake(x,(self.frame.size.height-diameter)/2,diameter,diameter));
|
||||
}
|
||||
}
|
||||
else if (self.pageControlStyle==PageControlStylePressed1 || self.pageControlStyle==PageControlStylePressed2)
|
||||
{
|
||||
if (self.pageControlStyle==PageControlStylePressed1)
|
||||
{
|
||||
CGContextSetFillColorWithColor(myContext, [[UIColor colorWithRed:0 green:0 blue:0 alpha:1] CGColor]);
|
||||
CGContextFillEllipseInRect(myContext, CGRectMake(x,(self.frame.size.height-diameter)/2-1,diameter,diameter));
|
||||
}
|
||||
else if (self.pageControlStyle==PageControlStylePressed2)
|
||||
{
|
||||
CGContextSetFillColorWithColor(myContext, [[UIColor colorWithRed:0.9 green:0.9 blue:0.9 alpha:1] CGColor]);
|
||||
CGContextFillEllipseInRect(myContext, CGRectMake(x,(self.frame.size.height-diameter)/2+1,diameter,diameter));
|
||||
}
|
||||
|
||||
|
||||
if (i==self.currentPage)
|
||||
{
|
||||
CGContextSetFillColorWithColor(myContext, [coreSelectedColor CGColor]);
|
||||
CGContextFillEllipseInRect(myContext, CGRectMake(x,(self.frame.size.height-diameter)/2,diameter,diameter));
|
||||
CGContextSetStrokeColorWithColor(myContext, [strokeSelectedColor CGColor]);
|
||||
CGContextStrokeEllipseInRect(myContext, CGRectMake(x,(self.frame.size.height-diameter)/2,diameter,diameter));
|
||||
}
|
||||
else
|
||||
{
|
||||
CGContextSetFillColorWithColor(myContext, [coreNormalColor CGColor]);
|
||||
CGContextFillEllipseInRect(myContext, CGRectMake(x,(self.frame.size.height-diameter)/2,diameter,diameter));
|
||||
CGContextSetStrokeColorWithColor(myContext, [strokeNormalColor CGColor]);
|
||||
CGContextStrokeEllipseInRect(myContext, CGRectMake(x,(self.frame.size.height-diameter)/2,diameter,diameter));
|
||||
}
|
||||
}
|
||||
else if (self.pageControlStyle==PageControlStyleThumb)
|
||||
{
|
||||
UIImage* thumbImage = [self thumbImageForIndex:i];
|
||||
UIImage* selectedThumbImage = [self selectedThumbImageForIndex:i];
|
||||
|
||||
if (thumbImage && selectedThumbImage)
|
||||
{
|
||||
if (i==self.currentPage)
|
||||
{
|
||||
[selectedThumbImage drawInRect:CGRectMake(x,(self.frame.size.height-selectedThumbImage.size.height)/2, selectedThumbImage.size.width, selectedThumbImage.size.height)];
|
||||
}
|
||||
else
|
||||
{
|
||||
[thumbImage drawInRect:CGRectMake(x,(self.frame.size.height-thumbImage.size.height)/2, thumbImage.size.width, thumbImage.size.height)];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setPageControlStyle:(PageControlStyle)style
|
||||
{
|
||||
_pageControlStyle = style;
|
||||
[self setNeedsDisplay];
|
||||
}
|
||||
|
||||
- (void)setCurrentPage:(int)page
|
||||
{
|
||||
_currentPage = page;
|
||||
[self setNeedsDisplay];
|
||||
}
|
||||
|
||||
- (void)setNumberOfPages:(int)numOfPages
|
||||
{
|
||||
_numberOfPages = numOfPages;
|
||||
[self setNeedsDisplay];
|
||||
}
|
||||
|
||||
- (void)setThumbImage:(UIImage *)aThumbImage forIndex:(NSInteger)index
|
||||
{
|
||||
if (self.thumbImageForIndex == nil)
|
||||
{
|
||||
[self setThumbImageForIndex:[NSMutableDictionary dictionary]];
|
||||
}
|
||||
|
||||
if ((aThumbImage != nil))
|
||||
[self.thumbImageForIndex setObject:aThumbImage forKey:@(index)];
|
||||
else
|
||||
[self.thumbImageForIndex removeObjectForKey:@(index)];
|
||||
|
||||
[self setNeedsDisplay];
|
||||
}
|
||||
|
||||
- (UIImage *)thumbImageForIndex:(NSInteger)index
|
||||
{
|
||||
UIImage* aThumbImage = [self.thumbImageForIndex objectForKey:@(index)];
|
||||
if (aThumbImage == nil)
|
||||
aThumbImage = self.thumbImage;
|
||||
|
||||
return aThumbImage;
|
||||
}
|
||||
|
||||
- (void)setSelectedThumbImage:(UIImage *)aSelectedThumbImage forIndex:(NSInteger)index
|
||||
{
|
||||
if (self.selectedThumbImageForIndex == nil)
|
||||
{
|
||||
[self setSelectedThumbImageForIndex:[NSMutableDictionary dictionary]];
|
||||
}
|
||||
|
||||
if ((aSelectedThumbImage != nil))
|
||||
[self.selectedThumbImageForIndex setObject:aSelectedThumbImage forKey:@(index)];
|
||||
else
|
||||
[self.selectedThumbImageForIndex removeObjectForKey:@(index)];
|
||||
|
||||
[self setNeedsDisplay];
|
||||
}
|
||||
|
||||
- (UIImage *)selectedThumbImageForIndex:(NSInteger)index
|
||||
{
|
||||
UIImage* aSelectedThumbImage = [self.selectedThumbImageForIndex objectForKey:@(index)];
|
||||
if (aSelectedThumbImage == nil)
|
||||
aSelectedThumbImage = self.selectedThumbImage;
|
||||
|
||||
return aSelectedThumbImage;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -27,12 +27,12 @@
|
||||
_serviceNav = [[UINavigationController alloc] initWithRootViewController:[[ServiceViewController alloc] init]];
|
||||
_navigateNav = [[UINavigationController alloc] initWithRootViewController:[[NavigateViewController alloc] init]];
|
||||
_myNav = [[UINavigationController alloc] initWithRootViewController:[[MyViewController alloc] init]];
|
||||
[_serviceNav setTabBarItem:[[UITabBarItem alloc] initWithTitle:@"职能导航" image:[UIImage imageNamed:@"seriviceno"] selectedImage:[UIImage imageNamed:@"seriviced"]]];
|
||||
[_navigateNav setTabBarItem:[[UITabBarItem alloc] initWithTitle:@"职能导航" image:[UIImage imageNamed:@"seriviceno"] selectedImage:[UIImage imageNamed:@"seriviced"]]];
|
||||
|
||||
[_navigateNav setTabBarItem:[[UITabBarItem alloc] initWithTitle:@"医疗服务" image:[UIImage imageNamed:@"seriviceno"] selectedImage:[UIImage imageNamed:@"seriviced"]]];
|
||||
[_serviceNav setTabBarItem:[[UITabBarItem alloc] initWithTitle:@"医疗服务" image:[UIImage imageNamed:@"seriviceno"] selectedImage:[UIImage imageNamed:@"seriviced"]]];
|
||||
|
||||
[_myNav setTabBarItem:[[UITabBarItem alloc] initWithTitle:@"个人中心" image:[UIImage imageNamed:@"myno"] selectedImage:[UIImage imageNamed:@"myed"]]];
|
||||
self.viewControllers = @[_serviceNav, _navigateNav, _myNav];
|
||||
self.viewControllers = @[_navigateNav,_serviceNav, _myNav];
|
||||
|
||||
}
|
||||
return self;
|
||||
@@ -42,10 +42,15 @@
|
||||
// Do any additional setup after loading the view.
|
||||
|
||||
[[UITableViewHeaderFooterView appearance] setTintColor:[UIColor clearColor]];
|
||||
|
||||
[[UITabBar appearance] setTintColor:[UIColor appMainColor]];
|
||||
|
||||
[UIBarButtonItem.appearance setTintColor:[UIColor blackColor]];
|
||||
[[UINavigationBar appearance] setTintColor:[UIColor blackColor]];
|
||||
|
||||
[[UINavigationBar appearance] setBarTintColor:[UIColor appMainColor]];
|
||||
[[UINavigationBar appearance] setBackgroundColor:[UIColor appMainColor]];
|
||||
// [[UINavigationBar appearance] setTranslucent:YES];
|
||||
[[UINavigationBar appearance] setBarStyle:UIBarStyleBlackTranslucent];
|
||||
|
||||
self.selectedIndex = 1;
|
||||
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
//
|
||||
// MyTopView.h
|
||||
// Doctor
|
||||
//
|
||||
// Created by xmfish on 15/11/27.
|
||||
// Copyright © 2015年 ash. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface MyTopView : UIView
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,21 @@
|
||||
//
|
||||
// MyTopView.m
|
||||
// Doctor
|
||||
//
|
||||
// Created by xmfish on 15/11/27.
|
||||
// Copyright © 2015年 ash. All rights reserved.
|
||||
//
|
||||
|
||||
#import "MyTopView.h"
|
||||
|
||||
@implementation MyTopView
|
||||
|
||||
/*
|
||||
// Only override drawRect: if you perform custom drawing.
|
||||
// An empty implementation adversely affects performance during animation.
|
||||
- (void)drawRect:(CGRect)rect {
|
||||
// Drawing code
|
||||
}
|
||||
*/
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,53 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="9059" systemVersion="14F27" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9049"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<view contentMode="scaleToFill" id="iN0-l3-epB" customClass="MyTopView">
|
||||
<rect key="frame" x="0.0" y="0.0" width="331" height="173"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="avatar.png" highlightedImage="avatar.png" translatesAutoresizingMaskIntoConstraints="NO" id="hO0-sY-dGV">
|
||||
<rect key="frame" x="135" y="29" width="61" height="61"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="61" id="MIa-vq-MuN"/>
|
||||
<constraint firstAttribute="height" constant="61" id="vjO-ys-2Wn"/>
|
||||
</constraints>
|
||||
</imageView>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="vuU-dH-1Ob">
|
||||
<rect key="frame" x="146" y="98" width="38" height="18"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="15"/>
|
||||
<color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="5cA-Mn-6fK">
|
||||
<rect key="frame" x="152" y="117" width="27" height="12"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="10"/>
|
||||
<color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
<color key="backgroundColor" red="0.17254901960784313" green="0.76078431372549016" blue="0.44313725490196076" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<constraints>
|
||||
<constraint firstItem="vuU-dH-1Ob" firstAttribute="top" secondItem="hO0-sY-dGV" secondAttribute="bottom" constant="8" id="EdA-UG-u7v"/>
|
||||
<constraint firstItem="vuU-dH-1Ob" firstAttribute="centerX" secondItem="iN0-l3-epB" secondAttribute="centerX" id="GHp-cB-ESi"/>
|
||||
<constraint firstItem="5cA-Mn-6fK" firstAttribute="centerX" secondItem="iN0-l3-epB" secondAttribute="centerX" id="Jn7-HQ-7Sd"/>
|
||||
<constraint firstItem="hO0-sY-dGV" firstAttribute="centerX" secondItem="iN0-l3-epB" secondAttribute="centerX" id="PU0-Sx-nTK"/>
|
||||
<constraint firstItem="hO0-sY-dGV" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" constant="29" id="SVg-8t-o6e"/>
|
||||
<constraint firstItem="5cA-Mn-6fK" firstAttribute="top" secondItem="vuU-dH-1Ob" secondAttribute="bottom" constant="1" id="VOy-Q0-BT8"/>
|
||||
</constraints>
|
||||
<nil key="simulatedStatusBarMetrics"/>
|
||||
<nil key="simulatedTopBarMetrics"/>
|
||||
<nil key="simulatedBottomBarMetrics"/>
|
||||
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
|
||||
<point key="canvasLocation" x="253.5" y="343.5"/>
|
||||
</view>
|
||||
</objects>
|
||||
<resources>
|
||||
<image name="avatar.png" width="61" height="60"/>
|
||||
</resources>
|
||||
</document>
|
||||
@@ -9,5 +9,6 @@
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface MyViewController : UIViewController
|
||||
@property (weak, nonatomic) IBOutlet UITableView *tableView;
|
||||
|
||||
@end
|
||||
|
||||
@@ -7,9 +7,11 @@
|
||||
//
|
||||
|
||||
#import "MyViewController.h"
|
||||
|
||||
#import "MyTopView.h"
|
||||
@interface MyViewController ()
|
||||
|
||||
{
|
||||
MyTopView *_myTopView;
|
||||
}
|
||||
@end
|
||||
|
||||
@implementation MyViewController
|
||||
@@ -17,6 +19,12 @@
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view from its nib.
|
||||
self.title = @"个人中心";
|
||||
|
||||
_myTopView = [Ash_UIUtil instanceXibView:@"MyTopView"];
|
||||
|
||||
_myTopView.frame = CGRectMake(0, 0, kScreenWidth, 200);
|
||||
|
||||
}
|
||||
|
||||
- (void)didReceiveMemoryWarning {
|
||||
|
||||
@@ -1,19 +1,38 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="6211" systemVersion="14A298i" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="9059" systemVersion="14F27" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6204"/>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9049"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="MyViewController">
|
||||
<connections>
|
||||
<outlet property="tableView" destination="iMZ-wr-fpQ" id="jgr-Km-pLn"/>
|
||||
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
|
||||
</connections>
|
||||
</placeholder>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="iMZ-wr-fpQ">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<connections>
|
||||
<outlet property="dataSource" destination="-1" id="S7d-2w-txw"/>
|
||||
<outlet property="delegate" destination="-1" id="pfE-gM-BFe"/>
|
||||
</connections>
|
||||
</tableView>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
|
||||
<constraints>
|
||||
<constraint firstItem="iMZ-wr-fpQ" firstAttribute="top" secondItem="i5M-Pr-FkT" secondAttribute="top" id="9By-zu-jZq"/>
|
||||
<constraint firstAttribute="trailing" secondItem="iMZ-wr-fpQ" secondAttribute="trailing" id="Fld-Eu-tvc"/>
|
||||
<constraint firstItem="iMZ-wr-fpQ" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" id="WHJ-FQ-wua"/>
|
||||
<constraint firstAttribute="bottom" secondItem="iMZ-wr-fpQ" secondAttribute="bottom" id="bqw-CO-Pvl"/>
|
||||
</constraints>
|
||||
<simulatedScreenMetrics key="simulatedDestinationMetrics" type="retina4"/>
|
||||
</view>
|
||||
</objects>
|
||||
</document>
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view from its nib.
|
||||
self.title = @"职能导航";
|
||||
}
|
||||
|
||||
- (void)didReceiveMemoryWarning {
|
||||
|
||||
@@ -7,9 +7,12 @@
|
||||
//
|
||||
|
||||
#import "ServiceViewController.h"
|
||||
#import "YKuImageInLoopScrollView.h"
|
||||
@interface ServiceViewController ()<YKuImageInLoopScrollViewDelegate>
|
||||
{
|
||||
|
||||
@interface ServiceViewController ()
|
||||
|
||||
}
|
||||
@property(nonatomic,strong)YKuImageInLoopScrollView* mYKuImageInLoopScrollView;
|
||||
@end
|
||||
|
||||
@implementation ServiceViewController
|
||||
@@ -17,13 +20,87 @@
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view from its nib.
|
||||
self.title = @"医疗服务";
|
||||
|
||||
|
||||
_mYKuImageInLoopScrollView = [[YKuImageInLoopScrollView alloc] initWithFrame:CGRectMake(0, 64, kScreenWidth, 250)
|
||||
pageControlStyle:PageControlStyleSquareRect position:PageControlSiteLeft
|
||||
gapWidth:4
|
||||
selectedColor:[UIColor appMainColor]];
|
||||
|
||||
|
||||
_mYKuImageInLoopScrollView.delegate = self;
|
||||
_mYKuImageInLoopScrollView.scrollViewType = ScrollViewDefault;
|
||||
_mYKuImageInLoopScrollView.backgroundColor = [UIColor whiteColor];
|
||||
[self.view addSubview:_mYKuImageInLoopScrollView];
|
||||
|
||||
|
||||
}
|
||||
-(void)viewWillAppear:(BOOL)animated
|
||||
{
|
||||
[super viewWillAppear:animated];
|
||||
|
||||
}
|
||||
-(void)viewDidAppear:(BOOL)animated
|
||||
{
|
||||
[super viewDidAppear:animated];
|
||||
[_mYKuImageInLoopScrollView reloadData];
|
||||
|
||||
}
|
||||
#pragma mark - YKuImageInLoopScrollViewDelegate
|
||||
- (int)numOfPageForScrollView:(YKuImageInLoopScrollView *)ascrollView
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
|
||||
- (int)widthForScrollView:(YKuImageInLoopScrollView *)ascrollView
|
||||
{
|
||||
return kScreenWidth;
|
||||
}
|
||||
|
||||
- (UIView *)scrollView:(YKuImageInLoopScrollView *)ascrollView viewAtPageIndex:(int)apageIndex
|
||||
{
|
||||
|
||||
CGFloat height = _mYKuImageInLoopScrollView.frame.size.height;
|
||||
|
||||
NSLog(@"%f",_mYKuImageInLoopScrollView.frame.origin.y);
|
||||
UIView *view = [[UIView alloc]initWithFrame:CGRectMake(0, 0, kScreenWidth, height)];
|
||||
UIImageView *oneimage = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, kScreenWidth, height)];
|
||||
|
||||
oneimage.contentMode = UIViewContentModeScaleAspectFill;
|
||||
[oneimage setImage:[UIImage imageNamed:@"bannerbg"]];
|
||||
|
||||
[view addSubview:oneimage];
|
||||
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
- (void)scrollView:(YKuImageInLoopScrollView*) ascrollView didTapIndex:(int)apageIndex
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
- (void) scrollView:(YKuImageInLoopScrollView*) ascrollView didSelectedPageIndex:(int)apageIndex
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
- (void)scrollViewWillBeginDecelerating:(YKuImageInLoopScrollView*)ascrollView
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
- (void)scrollViewDidEndDecelerating:(YKuImageInLoopScrollView*)ascrollView
|
||||
{
|
||||
|
||||
}
|
||||
- (void)didReceiveMemoryWarning {
|
||||
[super didReceiveMemoryWarning];
|
||||
// Dispose of any resources that can be recreated.
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
#pragma mark - Navigation
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="6211" systemVersion="14A298i" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="9059" systemVersion="14F27" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6204"/>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9049"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="ServiceViewController">
|
||||
@@ -11,9 +12,85 @@
|
||||
</placeholder>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="yrT-YY-Wq7">
|
||||
<rect key="frame" x="0.0" y="250" width="320" height="318"/>
|
||||
<subviews>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="1Ra-0V-eTg">
|
||||
<rect key="frame" x="30" y="110" width="59" height="59"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="59" id="LBa-mX-uhz"/>
|
||||
<constraint firstAttribute="width" constant="59" id="wTq-yQ-jN5"/>
|
||||
</constraints>
|
||||
<state key="normal" backgroundImage="yuyuezixun.png"/>
|
||||
</button>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="giz-nm-JdF">
|
||||
<rect key="frame" x="231" y="110" width="59" height="59"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="59" id="nqH-3T-fU1"/>
|
||||
<constraint firstAttribute="height" constant="59" id="xE0-5k-3Zm"/>
|
||||
</constraints>
|
||||
<state key="normal" backgroundImage="yiliaoxuqiu.png"/>
|
||||
</button>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="tTK-29-WnE">
|
||||
<rect key="frame" x="131" y="110" width="59" height="59"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="59" id="GKz-U2-1u1"/>
|
||||
<constraint firstAttribute="width" constant="59" id="udJ-ev-Bek"/>
|
||||
</constraints>
|
||||
<state key="normal" backgroundImage="jiankantijian.png"/>
|
||||
</button>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="预约咨询" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="bjz-KA-X7S">
|
||||
<rect key="frame" x="31" y="187" width="56" height="17"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="14"/>
|
||||
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="健康体检" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="YDa-qI-DaP">
|
||||
<rect key="frame" x="132" y="187" width="56" height="17"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="14"/>
|
||||
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="医疗需求" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="jBW-sR-nlp">
|
||||
<rect key="frame" x="232" y="187" width="56" height="17"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="14"/>
|
||||
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="trailing" secondItem="giz-nm-JdF" secondAttribute="trailing" constant="30" id="0r9-Fe-Bb0"/>
|
||||
<constraint firstItem="tTK-29-WnE" firstAttribute="centerX" secondItem="yrT-YY-Wq7" secondAttribute="centerX" id="6KH-9c-mJK"/>
|
||||
<constraint firstItem="bjz-KA-X7S" firstAttribute="top" secondItem="1Ra-0V-eTg" secondAttribute="bottom" constant="18" id="90F-l8-raO"/>
|
||||
<constraint firstItem="1Ra-0V-eTg" firstAttribute="leading" secondItem="yrT-YY-Wq7" secondAttribute="leading" constant="30" id="Bmd-5Y-u3F"/>
|
||||
<constraint firstItem="bjz-KA-X7S" firstAttribute="centerX" secondItem="1Ra-0V-eTg" secondAttribute="centerX" id="HHP-7Z-cUD"/>
|
||||
<constraint firstItem="YDa-qI-DaP" firstAttribute="top" secondItem="tTK-29-WnE" secondAttribute="bottom" constant="18" id="MJP-eO-X7i"/>
|
||||
<constraint firstItem="jBW-sR-nlp" firstAttribute="top" secondItem="giz-nm-JdF" secondAttribute="bottom" constant="18" id="Qcc-WT-v8g"/>
|
||||
<constraint firstItem="jBW-sR-nlp" firstAttribute="centerX" secondItem="giz-nm-JdF" secondAttribute="centerX" id="VIV-e6-p8g"/>
|
||||
<constraint firstItem="tTK-29-WnE" firstAttribute="top" secondItem="yrT-YY-Wq7" secondAttribute="top" constant="110" id="bYk-GX-SAJ"/>
|
||||
<constraint firstItem="YDa-qI-DaP" firstAttribute="centerX" secondItem="tTK-29-WnE" secondAttribute="centerX" id="bhN-Y4-hIS"/>
|
||||
<constraint firstItem="giz-nm-JdF" firstAttribute="top" secondItem="yrT-YY-Wq7" secondAttribute="top" constant="110" id="ws6-4N-Tcw"/>
|
||||
<constraint firstItem="1Ra-0V-eTg" firstAttribute="top" secondItem="yrT-YY-Wq7" secondAttribute="top" constant="110" id="zZo-eA-KLd"/>
|
||||
</constraints>
|
||||
</view>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="bottom" secondItem="yrT-YY-Wq7" secondAttribute="bottom" id="CyT-eK-HWd"/>
|
||||
<constraint firstAttribute="trailing" secondItem="yrT-YY-Wq7" secondAttribute="trailing" id="Sfk-bM-DOI"/>
|
||||
<constraint firstItem="yrT-YY-Wq7" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" id="a0F-Rs-7Pa"/>
|
||||
<constraint firstItem="yrT-YY-Wq7" firstAttribute="top" secondItem="i5M-Pr-FkT" secondAttribute="top" constant="250" id="fBP-Wk-biu"/>
|
||||
</constraints>
|
||||
<simulatedScreenMetrics key="simulatedDestinationMetrics" type="retina4"/>
|
||||
</view>
|
||||
</objects>
|
||||
<resources>
|
||||
<image name="jiankantijian.png" width="58" height="59"/>
|
||||
<image name="yiliaoxuqiu.png" width="58" height="59"/>
|
||||
<image name="yuyuezixun.png" width="59" height="59"/>
|
||||
</resources>
|
||||
</document>
|
||||
|
||||