diff --git a/Doctor.xcodeproj/project.pbxproj b/Doctor.xcodeproj/project.pbxproj index 10d1fb7..0bf2603 100644 --- a/Doctor.xcodeproj/project.pbxproj +++ b/Doctor.xcodeproj/project.pbxproj @@ -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 = ""; }; 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 = ""; }; 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 = ""; }; + A900FCFD1C07F9C6007B2E40 /* yiliaoxuqiu@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "yiliaoxuqiu@3x.png"; sourceTree = ""; }; + A900FCFE1C07F9C6007B2E40 /* yuyuezixun@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "yuyuezixun@3x.png"; sourceTree = ""; }; + A900FD021C07F9EE007B2E40 /* jiankantijian@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "jiankantijian@2x.png"; sourceTree = ""; }; + A900FD031C07F9EE007B2E40 /* yiliaoxuqiu@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "yiliaoxuqiu@2x.png"; sourceTree = ""; }; + A900FD041C07F9EE007B2E40 /* yuyuezixun@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "yuyuezixun@2x.png"; sourceTree = ""; }; + A900FD091C07FEBC007B2E40 /* MyTopView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MyTopView.h; sourceTree = ""; }; + A900FD0A1C07FEBC007B2E40 /* MyTopView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MyTopView.m; sourceTree = ""; }; + A900FD0C1C07FF88007B2E40 /* MyTopView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MyTopView.xib; sourceTree = ""; }; + A900FD0E1C080066007B2E40 /* avatar@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "avatar@2x.png"; sourceTree = ""; }; + A900FD101C080072007B2E40 /* avatar@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "avatar@3x.png"; sourceTree = ""; }; 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 = ""; }; A9841F241C04357C00FB72AA /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; @@ -118,6 +142,10 @@ A986A3A21C04CE1800B55F38 /* CommonUtil.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CommonUtil.m; sourceTree = ""; }; A986A3A31C04CE1800B55F38 /* UIImageView+Reloading.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIImageView+Reloading.h"; sourceTree = ""; }; A986A3A41C04CE1800B55F38 /* UIImageView+Reloading.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIImageView+Reloading.m"; sourceTree = ""; }; + A986A3A91C04D30000B55F38 /* YKuImageInLoopScrollView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = YKuImageInLoopScrollView.h; sourceTree = ""; }; + A986A3AA1C04D30000B55F38 /* YKuImageInLoopScrollView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = YKuImageInLoopScrollView.m; sourceTree = ""; }; + A986A3AC1C04D63600B55F38 /* bannerbg@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "bannerbg@2x.png"; sourceTree = ""; }; + A986A3AE1C04D64B00B55F38 /* bannerbg@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "bannerbg@3x.png"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -140,6 +168,16 @@ name = Frameworks; sourceTree = ""; }; + A900FD081C07FE9D007B2E40 /* My */ = { + isa = PBXGroup; + children = ( + A900FD091C07FEBC007B2E40 /* MyTopView.h */, + A900FD0A1C07FEBC007B2E40 /* MyTopView.m */, + A900FD0C1C07FF88007B2E40 /* MyTopView.xib */, + ); + name = My; + sourceTree = ""; + }; 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 = ""; }; + A986A3A81C04D30000B55F38 /* YKuLoopScrollView */ = { + isa = PBXGroup; + children = ( + A986A3A91C04D30000B55F38 /* YKuImageInLoopScrollView.h */, + A986A3AA1C04D30000B55F38 /* YKuImageInLoopScrollView.m */, + ); + path = YKuLoopScrollView; + sourceTree = ""; + }; 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 */, ); diff --git a/Doctor.xcworkspace/xcuserdata/xmfish.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/Doctor.xcworkspace/xcuserdata/xmfish.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 0000000..2d44699 --- /dev/null +++ b/Doctor.xcworkspace/xcuserdata/xmfish.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,343 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Doctor/AppDelegate.m b/Doctor/AppDelegate.m index 79e3583..f40d168 100644 --- a/Doctor/AppDelegate.m +++ b/Doctor/AppDelegate.m @@ -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; diff --git a/Doctor/PrefixHeader.pch b/Doctor/PrefixHeader.pch index e780a43..6303dd0 100644 --- a/Doctor/PrefixHeader.pch +++ b/Doctor/PrefixHeader.pch @@ -21,4 +21,6 @@ #import "MBProgressHUD+Util.h" #import "Ash_UIUtil.h" #import "CommonUtil.h" +#import +#import #endif /* PrefixHeader_pch */ diff --git a/Doctor/Resource/avatar@2x.png b/Doctor/Resource/avatar@2x.png new file mode 100644 index 0000000..3ed67cd Binary files /dev/null and b/Doctor/Resource/avatar@2x.png differ diff --git a/Doctor/Resource/avatar@3x.png b/Doctor/Resource/avatar@3x.png new file mode 100644 index 0000000..b8e8d7a Binary files /dev/null and b/Doctor/Resource/avatar@3x.png differ diff --git a/Doctor/Resource/bannerbg@2x.png b/Doctor/Resource/bannerbg@2x.png new file mode 100644 index 0000000..6843a8b Binary files /dev/null and b/Doctor/Resource/bannerbg@2x.png differ diff --git a/Doctor/Resource/bannerbg@3x.png b/Doctor/Resource/bannerbg@3x.png new file mode 100644 index 0000000..935e380 Binary files /dev/null and b/Doctor/Resource/bannerbg@3x.png differ diff --git a/Doctor/Resource/jiankantijian@2x.png b/Doctor/Resource/jiankantijian@2x.png new file mode 100644 index 0000000..7f76767 Binary files /dev/null and b/Doctor/Resource/jiankantijian@2x.png differ diff --git a/Doctor/Resource/jiankantijian@3x.png b/Doctor/Resource/jiankantijian@3x.png new file mode 100644 index 0000000..728a2e2 Binary files /dev/null and b/Doctor/Resource/jiankantijian@3x.png differ diff --git a/Doctor/Resource/yiliaoxuqiu@2x.png b/Doctor/Resource/yiliaoxuqiu@2x.png new file mode 100644 index 0000000..1c79bd2 Binary files /dev/null and b/Doctor/Resource/yiliaoxuqiu@2x.png differ diff --git a/Doctor/Resource/yiliaoxuqiu@3x.png b/Doctor/Resource/yiliaoxuqiu@3x.png new file mode 100644 index 0000000..ae6651c Binary files /dev/null and b/Doctor/Resource/yiliaoxuqiu@3x.png differ diff --git a/Doctor/Resource/yuyuezixun@2x.png b/Doctor/Resource/yuyuezixun@2x.png new file mode 100644 index 0000000..af9b986 Binary files /dev/null and b/Doctor/Resource/yuyuezixun@2x.png differ diff --git a/Doctor/Resource/yuyuezixun@3x.png b/Doctor/Resource/yuyuezixun@3x.png new file mode 100644 index 0000000..74b98e3 Binary files /dev/null and b/Doctor/Resource/yuyuezixun@3x.png differ diff --git a/Doctor/Util/Tool/Ash_UIUtil.m b/Doctor/Util/Tool/Ash_UIUtil.m index 6f79c46..812be6a 100644 --- a/Doctor/Util/Tool/Ash_UIUtil.m +++ b/Doctor/Util/Tool/Ash_UIUtil.m @@ -479,7 +479,7 @@ + (UIColor *)appMainColorAlpha:(CGFloat)alpha { - return [UIColor colorWithHexString:@"#61BFA9" alpha:1]; + return [UIColor colorWithHexString:@"#61BFA9" alpha:alpha]; } + (UIColor *)appNavBackgroundColor diff --git a/Doctor/Util/YKuLoopScrollView/YKuImageInLoopScrollView.h b/Doctor/Util/YKuLoopScrollView/YKuImageInLoopScrollView.h new file mode 100755 index 0000000..d1c0633 --- /dev/null +++ b/Doctor/Util/YKuLoopScrollView/YKuImageInLoopScrollView.h @@ -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 + +@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{ +@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 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 + +/* + 总共有多少页 + */ +- (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 + +-(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 + diff --git a/Doctor/Util/YKuLoopScrollView/YKuImageInLoopScrollView.m b/Doctor/Util/YKuLoopScrollView/YKuImageInLoopScrollView.m new file mode 100755 index 0000000..785db5a --- /dev/null +++ b/Doctor/Util/YKuLoopScrollView/YKuImageInLoopScrollView.m @@ -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 adelegate = (id) 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 adelegate = (id) 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 + */ +- (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 adelegate=(id) 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 adelegate=(id) 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)= 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)=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)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= (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 + +@interface MyTopView : UIView + +@end diff --git a/Doctor/View/MyTopView.m b/Doctor/View/MyTopView.m new file mode 100644 index 0000000..9badd00 --- /dev/null +++ b/Doctor/View/MyTopView.m @@ -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 diff --git a/Doctor/View/MyTopView.xib b/Doctor/View/MyTopView.xib new file mode 100644 index 0000000..ddef554 --- /dev/null +++ b/Doctor/View/MyTopView.xib @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Doctor/View/MyViewController.h b/Doctor/View/MyViewController.h index e821335..60a394a 100644 --- a/Doctor/View/MyViewController.h +++ b/Doctor/View/MyViewController.h @@ -9,5 +9,6 @@ #import @interface MyViewController : UIViewController +@property (weak, nonatomic) IBOutlet UITableView *tableView; @end diff --git a/Doctor/View/MyViewController.m b/Doctor/View/MyViewController.m index 35ff697..3f0badb 100644 --- a/Doctor/View/MyViewController.m +++ b/Doctor/View/MyViewController.m @@ -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 { diff --git a/Doctor/View/MyViewController.xib b/Doctor/View/MyViewController.xib index f66b815..4487c8d 100644 --- a/Doctor/View/MyViewController.xib +++ b/Doctor/View/MyViewController.xib @@ -1,19 +1,38 @@ - + - + + + - + + + + + + + + + + + + + + + + + + diff --git a/Doctor/View/NavigateViewController.m b/Doctor/View/NavigateViewController.m index 5c666f3..dc0e743 100644 --- a/Doctor/View/NavigateViewController.m +++ b/Doctor/View/NavigateViewController.m @@ -17,6 +17,7 @@ - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view from its nib. + self.title = @"职能导航"; } - (void)didReceiveMemoryWarning { diff --git a/Doctor/View/ServiceViewController.m b/Doctor/View/ServiceViewController.m index 7d11a08..f47ecfc 100644 --- a/Doctor/View/ServiceViewController.m +++ b/Doctor/View/ServiceViewController.m @@ -7,9 +7,12 @@ // #import "ServiceViewController.h" +#import "YKuImageInLoopScrollView.h" +@interface ServiceViewController () +{ -@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 diff --git a/Doctor/View/ServiceViewController.xib b/Doctor/View/ServiceViewController.xib index d3c353b..4b87ec8 100644 --- a/Doctor/View/ServiceViewController.xib +++ b/Doctor/View/ServiceViewController.xib @@ -1,7 +1,8 @@ - + - + + @@ -11,9 +12,85 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +