Skip to content

Commit bc4da62

Browse files
author
lianchen
committed
重置代码
1 parent ae906a5 commit bc4da62

12 files changed

+1245
-246
lines changed

Example/Demo/TestViewController2.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ - (void)testPageView
7070
headView.frame = CGRectMake(0, 0, kScreenW, 150);
7171

7272
LCPageViewStyle *style = [[LCPageViewStyle alloc] init];
73-
73+
[style initNormalStyle];
7474
CGRect frame = CGRectMake(0, 64, kScreenW, kScreenH - 64);
7575
/// 自定义标题
7676
TestTitleView *titleView = [[TestTitleView alloc] initWithFrame:CGRectMake(0,0, kScreenW, 38) titles:titles pageViewStyle:style];

Example/Example.xcodeproj/project.pbxproj

+8-2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
C857069720ADB22400397593 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C857068F20ADB22400397593 /* ViewController.m */; };
2323
C857069920ADB22400397593 /* TestViewController2.m in Sources */ = {isa = PBXBuildFile; fileRef = C857069120ADB22400397593 /* TestViewController2.m */; };
2424
C857069A20ADB22400397593 /* TestTitleView.m in Sources */ = {isa = PBXBuildFile; fileRef = C857069220ADB22400397593 /* TestTitleView.m */; };
25+
C878B4E422D482100027E862 /* UIView+LCFrame.m in Sources */ = {isa = PBXBuildFile; fileRef = C878B4E222D4820F0027E862 /* UIView+LCFrame.m */; };
2526
/* End PBXBuildFile section */
2627

2728
/* Begin PBXFileReference section */
@@ -39,7 +40,6 @@
3940
C857067B20ADB08900397593 /* LCPageViewStyle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LCPageViewStyle.m; sourceTree = "<group>"; };
4041
C857067C20ADB08900397593 /* LCTitleView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LCTitleView.h; sourceTree = "<group>"; };
4142
C857067D20ADB08A00397593 /* MainScrollView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MainScrollView.m; sourceTree = "<group>"; };
42-
C857067E20ADB08A00397593 /* LCPageContentViewProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LCPageContentViewProtocol.h; sourceTree = "<group>"; };
4343
C857067F20ADB08A00397593 /* LCPageView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LCPageView.h; sourceTree = "<group>"; };
4444
C857068020ADB08A00397593 /* UIScrollView+Category.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIScrollView+Category.h"; sourceTree = "<group>"; };
4545
C857068120ADB08A00397593 /* UIScrollView+Category.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIScrollView+Category.m"; sourceTree = "<group>"; };
@@ -54,6 +54,9 @@
5454
C857069320ADB22400397593 /* TestTitleView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TestTitleView.h; sourceTree = "<group>"; };
5555
C857069420ADB22400397593 /* TestViewController2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TestViewController2.h; sourceTree = "<group>"; };
5656
C857069520ADB22400397593 /* TestViewController3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TestViewController3.h; sourceTree = "<group>"; };
57+
C878B4E122D481850027E862 /* LCPageViewProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LCPageViewProtocol.h; sourceTree = "<group>"; };
58+
C878B4E222D4820F0027E862 /* UIView+LCFrame.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIView+LCFrame.m"; sourceTree = "<group>"; };
59+
C878B4E322D4820F0027E862 /* UIView+LCFrame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+LCFrame.h"; sourceTree = "<group>"; };
5760
/* End PBXFileReference section */
5861

5962
/* Begin PBXFrameworksBuildPhase section */
@@ -102,7 +105,6 @@
102105
C857066420ADB04500397593 /* Source */ = {
103106
isa = PBXGroup;
104107
children = (
105-
C857067E20ADB08A00397593 /* LCPageContentViewProtocol.h */,
106108
C857067F20ADB08A00397593 /* LCPageView.h */,
107109
C857067920ADB08900397593 /* LCPageView.m */,
108110
C857068320ADB08A00397593 /* LCPageViewStyle.h */,
@@ -111,6 +113,9 @@
111113
C857067820ADB08900397593 /* LCTitleView.m */,
112114
C857068420ADB08A00397593 /* MainScrollView.h */,
113115
C857067D20ADB08A00397593 /* MainScrollView.m */,
116+
C878B4E322D4820F0027E862 /* UIView+LCFrame.h */,
117+
C878B4E222D4820F0027E862 /* UIView+LCFrame.m */,
118+
C878B4E122D481850027E862 /* LCPageViewProtocol.h */,
114119
C857068020ADB08A00397593 /* UIScrollView+Category.h */,
115120
C857068120ADB08A00397593 /* UIScrollView+Category.m */,
116121
C857068220ADB08A00397593 /* UIViewController+Category.h */,
@@ -216,6 +221,7 @@
216221
C857068820ADB08A00397593 /* LCPageViewStyle.m in Sources */,
217222
C857068620ADB08A00397593 /* LCPageView.m in Sources */,
218223
C857068720ADB08A00397593 /* UIViewController+Category.m in Sources */,
224+
C878B4E422D482100027E862 /* UIView+LCFrame.m in Sources */,
219225
C857065020ADAF9E00397593 /* AppDelegate.m in Sources */,
220226
);
221227
runOnlyForDeploymentPostprocessing = 0;

Source/LCPageContentViewProtocol.h

-29
This file was deleted.

Source/LCPageView.h

+38-7
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,48 @@
22
// LCPageView.h
33
// LCPageView
44
//
5-
// Created by 复新会智 on 2018/5/9.
6-
// Copyright © 2018年 复新会智. All rights reserved.
5+
// Created by lianchen on 2018/5/9.
6+
// Copyright © 2018年 lianchen. All rights reserved.
77
//
88

99
#import <UIKit/UIKit.h>
1010
#import "LCPageViewStyle.h"
1111
#import "MainScrollView.h"
1212
#import "LCTitleView.h"
13+
#import "LCHeadView.h"
1314
#import "UIViewController+Category.h"
15+
#import "LCPageViewProtocol.h"
16+
17+
@class LCPageView;
18+
@protocol LCPageViewDelegate <NSObject>
19+
/*
20+
*代理方法 这个方法是切换了选中的的代理方法
21+
*/
22+
- (void)pageView:(LCPageView *)pageView moveToIndex:(NSInteger)index;
23+
@end
24+
25+
1426

1527
@interface LCPageView : UIView
1628

29+
/** 代理 */
30+
@property(nonatomic, weak) id <LCPageViewDelegate>delegate;
31+
1732
/**
1833
最底部滚动视图
19-
主要用于整个控制器添加下拉刷新功能
34+
主要用于整个PageView添加下拉刷新功能
2035
bounces 默认为NO
2136
*/
2237
@property(nonatomic, strong, readonly)MainScrollView *mainScrollView;
2338

2439
/**
2540
初始化一个pageView
2641
使用注意(重要): 需要在内容控制器里面把主滚动视图赋值给 lcScrollView
27-
例如: self.lcScrollView = self.tableView;
28-
42+
例如: self.lcScrollView = self.tableView;
43+
2944
@param frame frame
3045
@param headView 头部视图
31-
@param childControllers 内容控制器
46+
@param childControllers 内容控制器(需要设置控制器的title)
3247
@param parentController 当前控制器
3348
@param customTitleView 自定义标题的View
3449
@param pageViewStyle pageView的样式(有默认的样式)
@@ -39,7 +54,23 @@
3954
childControllers:(NSArray <UIViewController *>*)childControllers
4055
parentController:(UIViewController *)parentController
4156
customTitleView:(LCTitleView *)customTitleView
42-
pageViewStyle:(LCPageViewStyle *)pageViewStyle;
57+
pageViewStyle:(id <LCPageViewStyleProtocol>)pageViewStyle;
58+
59+
60+
/**
61+
手动调用滚动
62+
*/
63+
- (void)moveToIndex:(NSInteger)index;
64+
65+
/**
66+
更新pageView的高度
67+
*/
68+
- (void)updatePageViewHeight:(CGFloat)height;
69+
70+
/**
71+
更新标题内容
72+
*/
73+
- (void)updatePageViewTitles:(NSArray <NSString *>*)titles;
4374

4475

4576
@end

0 commit comments

Comments
 (0)