diff --git a/ManagerDemo.xcworkspace/xcuserdata/xmfish.xcuserdatad/UserInterfaceState.xcuserstate b/ManagerDemo.xcworkspace/xcuserdata/xmfish.xcuserdatad/UserInterfaceState.xcuserstate
index 008c1f9..4bcd278 100644
Binary files a/ManagerDemo.xcworkspace/xcuserdata/xmfish.xcuserdatad/UserInterfaceState.xcuserstate and b/ManagerDemo.xcworkspace/xcuserdata/xmfish.xcuserdatad/UserInterfaceState.xcuserstate differ
diff --git a/ManagerDemo/Common/SlideSwitch/QCSlideSwitchView.m b/ManagerDemo/Common/SlideSwitch/QCSlideSwitchView.m
index 9b2bdf7..8b260c9 100644
--- a/ManagerDemo/Common/SlideSwitch/QCSlideSwitchView.m
+++ b/ManagerDemo/Common/SlideSwitch/QCSlideSwitchView.m
@@ -29,12 +29,16 @@ static const NSUInteger kTagOfRightSideButton = 999;
_topScrollView.showsVerticalScrollIndicator = NO;
_topScrollView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
//底部的线
+// UIView* lineView = [[UIView alloc] initWithFrame:CGRectMake(0, kHeightOfTopScrollView, 320, 3)];
+// lineView.alpha = 0.3;
+// [lineView setBackgroundColor:[UIColor blackColor]];
+// [_topScrollView addSubview:lineView]
[_topScrollView addSubview:[ManagerUtil lineWithColor:[UIColor grayColor] withAlpha:0.3 withFrame:CGRectMake(0, kHeightOfTopScrollView, 320, 1)]];
[self addSubview:_topScrollView];
_userSelectedChannelID = 100;
//创建主滚动视图
- _rootScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, kHeightOfTopScrollView, self.bounds.size.width, self.bounds.size.height - kHeightOfTopScrollView)];
+ _rootScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, kHeightOfTopScrollView+1, self.bounds.size.width, self.bounds.size.height - kHeightOfTopScrollView)];
_rootScrollView.delegate = self;
_rootScrollView.pagingEnabled = YES;
_rootScrollView.userInteractionEnabled = YES;
diff --git a/ManagerDemo/MainView/ListView/FundListCell.m b/ManagerDemo/MainView/ListView/FundListCell.m
index a06e17c..784e238 100644
--- a/ManagerDemo/MainView/ListView/FundListCell.m
+++ b/ManagerDemo/MainView/ListView/FundListCell.m
@@ -42,7 +42,7 @@
}
-(void)setLowestPriceWtihCount:(NSInteger)price
{
- NSString* htmlStr = [NSString stringWithFormat:@"%ld元起",price];
+ NSString* htmlStr = [NSString stringWithFormat:@"%ld元起",price];
NSData *data = [htmlStr dataUsingEncoding:NSUTF8StringEncoding];
NSDictionary* optionsDic = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:kCTTextAlignmentRight],DTDefaultTextAlignment,[UIColor grayColor],DTDefaultTextColor, nil];
NSAttributedString *percentString = [[NSAttributedString alloc] initWithHTMLData:data options:optionsDic documentAttributes:nil];
diff --git a/ManagerDemo/MainView/ListView/FundListCell.xib b/ManagerDemo/MainView/ListView/FundListCell.xib
index eb8a236..34ee7d2 100644
--- a/ManagerDemo/MainView/ListView/FundListCell.xib
+++ b/ManagerDemo/MainView/ListView/FundListCell.xib
@@ -1,73 +1,79 @@
-
+
-
-
+
+
-
+
-
diff --git a/ManagerDemo/MainView/ListView/FundListViewController.m b/ManagerDemo/MainView/ListView/FundListViewController.m
index 6ec24cd..88798cd 100644
--- a/ManagerDemo/MainView/ListView/FundListViewController.m
+++ b/ManagerDemo/MainView/ListView/FundListViewController.m
@@ -28,12 +28,22 @@
[super viewDidLoad];
// Do any additional setup after loading the view.
}
+#pragma mark MJRefreshDelegate
+-(void)headerRereshing
+{
+ _count = 15;
+ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+ // 刷新表格
+ [self.tableView reloadData];
+ [self headerEndRefreshing];
+ });
+}
#pragma mark UITableViewDelegate
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
return 1;
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
- return 10;
+ return _count;
}
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
diff --git a/ManagerDemo/MainView/ListView/ListViewController.h b/ManagerDemo/MainView/ListView/ListViewController.h
index 5414508..7cc88a4 100644
--- a/ManagerDemo/MainView/ListView/ListViewController.h
+++ b/ManagerDemo/MainView/ListView/ListViewController.h
@@ -11,9 +11,12 @@
@interface ListViewController : UIViewController
{
__weak UITableView* _tableView;
+ NSInteger _count;
}
@property (weak, nonatomic) IBOutlet UITableView *tableView;
-
+@property (assign, nonatomic)NSInteger count;
- (void)headerRereshing;
- (void)footerRereshing;
+- (void)headerBeginRefreshing;
+- (void)headerEndRefreshing;
@end
diff --git a/ManagerDemo/MainView/ListView/ListViewController.m b/ManagerDemo/MainView/ListView/ListViewController.m
index eb75d45..7853216 100644
--- a/ManagerDemo/MainView/ListView/ListViewController.m
+++ b/ManagerDemo/MainView/ListView/ListViewController.m
@@ -32,7 +32,7 @@
self.tableView.dataSource = self;
[self.tableView addHeaderWithTarget:self action:@selector(headerRereshing)];
[self.tableView addFooterWithTarget:self action:@selector(footerRereshing)];
-
+
}
#pragma mark MJRefreshDelegate
- (void)headerRereshing
@@ -50,7 +50,6 @@
- (void)footerRereshing
{
-
// 2.2秒后刷新表格UI
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
// 刷新表格
@@ -60,6 +59,14 @@
[self.tableView footerEndRefreshing];
});
}
+- (void)headerBeginRefreshing
+{
+ [self.tableView headerBeginRefreshing];
+}
+-(void)headerEndRefreshing
+{
+ [self.tableView headerEndRefreshing];
+}
#pragma mark UITableViewDelegate
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
return 1;
diff --git a/ManagerDemo/MainView/ListView/LoanListViewController.m b/ManagerDemo/MainView/ListView/LoanListViewController.m
index b905ab0..d37126f 100644
--- a/ManagerDemo/MainView/ListView/LoanListViewController.m
+++ b/ManagerDemo/MainView/ListView/LoanListViewController.m
@@ -10,7 +10,8 @@
#import "AdjustableUILable.h"
#import "LoanListCell.h"
@interface LoanListViewController ()
-
+{
+}
@end
@implementation LoanListViewController
@@ -28,14 +29,24 @@
{
[super viewDidLoad];
// Do any additional setup after loading the view.
+ [self headerBeginRefreshing];
+}
+#pragma mark MJRefreshDelegate
+-(void)headerRereshing
+{
+ _count = 10;
+ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+ // 刷新表格
+ [self.tableView reloadData];
+ [self headerEndRefreshing];
+ });
}
-
#pragma mark UITableViewDelegate
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
return 1;
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
- return 10;
+ return _count;
}
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
diff --git a/ManagerDemo/MainView/ListView/OtherListViewController.m b/ManagerDemo/MainView/ListView/OtherListViewController.m
index e41b784..b8864d3 100644
--- a/ManagerDemo/MainView/ListView/OtherListViewController.m
+++ b/ManagerDemo/MainView/ListView/OtherListViewController.m
@@ -7,7 +7,7 @@
//
#import "OtherListViewController.h"
-
+#import "FundListCell.h"
@interface OtherListViewController ()
@end
@@ -22,13 +22,50 @@
}
return self;
}
-
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view.
}
+#pragma mark MJRefreshDelegate
+-(void)headerRereshing
+{
+ _count = 6;
+ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+ // 刷新表格
+ [self.tableView reloadData];
+ [self headerEndRefreshing];
+ });
+}
+#pragma mark UITableViewDelegate
+-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
+ return 1;
+}
+-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
+ return _count;
+}
+-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
+{
+ CGFloat height = 108.0;
+ return height;
+
+}
+-(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
+{
+ static NSString *loanListCell = @"LoanListCell";
+ UITableViewCell* cell = [tableView dequeueReusableCellWithIdentifier:loanListCell];
+ if (cell == nil) {
+ cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:loanListCell];
+ NSArray *LoanListCellObjects = [[NSBundle mainBundle] loadNibNamed:@"FundListCell" owner:self options:nil];
+ cell = [LoanListCellObjects objectAtIndex:0];
+
+ }
+ [((FundListCell*)cell).totalLabel setText:@"已经有6783234人"];
+ return cell;
+}
+
+
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
diff --git a/ManagerDemo/MainViewControll/ProductListViewController.m b/ManagerDemo/MainViewControll/ProductListViewController.m
index c911d11..ca6509d 100644
--- a/ManagerDemo/MainViewControll/ProductListViewController.m
+++ b/ManagerDemo/MainViewControll/ProductListViewController.m
@@ -11,6 +11,14 @@
#import "FundListViewController.h"
#import "OtherListViewController.h"
@interface ProductListViewController ()
+{
+ LoanListViewController* _loanListViewController;
+ FundListViewController* _fundListViewController;
+ OtherListViewController* _otherListViewController;
+
+ NSInteger _nowSelectTab; //当前选择的界面。
+
+}
@end
@@ -21,6 +29,13 @@
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
+ _loanListViewController = [[LoanListViewController alloc] initWithNibName:@"ListViewController" bundle:nil];
+ _loanListViewController.title = @"列表1";
+ _fundListViewController = [[FundListViewController alloc] initWithNibName:@"ListViewController" bundle:nil];
+ _fundListViewController.title = @"列表2";
+ _otherListViewController = [[OtherListViewController alloc] initWithNibName:@"ListViewController" bundle:nil];
+ _otherListViewController.title = @"列表3";
+ _nowSelectTab = 0;
}
return self;
}
@@ -30,6 +45,8 @@
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
[ManagerUtil SetSubViewExternNone:self];
+ //右边按钮。
+ [self.navigationItem setRightBarButtonItem:[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(rightBarBtnClick:)]];
self.slideSwitchView.tabItemNormalColor = [QCSlideSwitchView colorFromHexRGB:@"868686"];
self.slideSwitchView.tabItemSelectedColor = [QCSlideSwitchView colorFromHexRGB:@"bb0b15"];
@@ -37,8 +54,27 @@
stretchableImageWithLeftCapWidth:59.0f topCapHeight:0.0f];
[self.navigationItem setTitle:@"第二页"];
[self.slideSwitchView buildUI];
+
+
}
+#pragma mark method
+-(void)rightBarBtnClick:(id)sender
+{
+ switch (_nowSelectTab) {
+ case 0:
+ [_loanListViewController headerBeginRefreshing];
+ break;
+ case 1:
+ [_fundListViewController headerBeginRefreshing];
+ break;
+ case 2:
+ [_otherListViewController headerBeginRefreshing];
+ break;
+ default:
+ break;
+ }
+}
#pragma mark - 滑动tab视图代理方法
@@ -55,21 +91,18 @@
switch (number) {
case 0:
{
- viewController = [[LoanListViewController alloc] initWithNibName:@"ListViewController" bundle:nil];
- viewController.title = @"列表1";
+ viewController = _loanListViewController;
}
break;
case 1:
{
- viewController = [[FundListViewController alloc] initWithNibName:@"ListViewController" bundle:nil];
- viewController.title = @"列表2";
+ viewController = _fundListViewController;
}
break;
case 2:
{
- viewController = [[OtherListViewController alloc] initWithNibName:@"ListViewController" bundle:nil];
- viewController.title = @"列表3";
+ viewController = _otherListViewController;
}
break;
@@ -84,6 +117,27 @@
- (void)slideSwitchView:(QCSlideSwitchView *)view didselectTab:(NSUInteger)number
{
DLog(@"%ld",number);
+ _nowSelectTab = number;
+ switch (number) {
+ case 0:
+ if (_loanListViewController.count <= 0) {
+ [_loanListViewController headerBeginRefreshing];
+ }
+ break;
+ case 1:
+ if (_fundListViewController.count <= 0) {
+ [_fundListViewController headerBeginRefreshing];
+ }
+ break;
+ case 2:
+ if (_otherListViewController.count <= 0) {
+ [_otherListViewController headerBeginRefreshing];
+ }
+ break;
+
+ default:
+ break;
+ }
}