Commit 04fe3824 authored by 乔金柱's avatar 乔金柱

修改emptyView 筛选器被覆盖情况

parent b9ada965
...@@ -15,7 +15,7 @@ PODS: ...@@ -15,7 +15,7 @@ PODS:
- AFNetworking/UIKit (3.1.0): - AFNetworking/UIKit (3.1.0):
- AFNetworking/NSURLSession - AFNetworking/NSURLSession
- Base64nl (1.2) - Base64nl (1.2)
- GMBase (0.0.25): - GMBase (0.1.0):
- GMHud - GMHud
- GMKit - GMKit
- GMNetService - GMNetService
...@@ -89,7 +89,7 @@ EXTERNAL SOURCES: ...@@ -89,7 +89,7 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS: SPEC CHECKSUMS:
AFNetworking: 5e0e199f73d8626b11e79750991f5d173d1f8b67 AFNetworking: 5e0e199f73d8626b11e79750991f5d173d1f8b67
Base64nl: a497bdcd1c01ea793d36b399016195a8713c0e95 Base64nl: a497bdcd1c01ea793d36b399016195a8713c0e95
GMBase: 05e9455c6f41f34462d2d2091427bbdb214779ca GMBase: 2e52cee3cab338dc00361b11bf12375c5284de56
GMCache: 73855b613b9d7e34f4f37ad425e8b8153b760c04 GMCache: 73855b613b9d7e34f4f37ad425e8b8153b760c04
GMFoundation: 395f1083c40aa38e9fb031726991dbc20247e2f9 GMFoundation: 395f1083c40aa38e9fb031726991dbc20247e2f9
GMHud: 67c24abb83777c61e43741d4a803f7b6d8ad4e1e GMHud: 67c24abb83777c61e43741d4a803f7b6d8ad4e1e
......
...@@ -42,12 +42,12 @@ ...@@ -42,12 +42,12 @@
_table.rowHeight = _cellHeight; _table.rowHeight = _cellHeight;
_table.delegate = self; _table.delegate = self;
_table.dataSource = self; _table.dataSource = self;
// 如果_cellIdentifier 能转成一个UITableViewCell class,才去注册,否则会有crash发生 // 如果_cellIdentifier 能转成一个UITableViewCell class,才去注册,否则会有crash发生
if ([NSClassFromString(_cellIdentifier) isSubclassOfClass:[UITableViewCell class]]) { if ([NSClassFromString(_cellIdentifier) isSubclassOfClass:[UITableViewCell class]]) {
[_table registerClass:NSClassFromString(_cellIdentifier) forCellReuseIdentifier:_cellIdentifier]; [_table registerClass:NSClassFromString(_cellIdentifier) forCellReuseIdentifier:_cellIdentifier];
} }
_table.backgroundColor = [UIColor clearColor]; _table.backgroundColor = [UIColor clearColor];
[self.view addSubview:_table]; [self.view addSubview:_table];
[_table mas_makeConstraints:^(MASConstraintMaker *make) { [_table mas_makeConstraints:^(MASConstraintMaker *make) {
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
make.top.mas_equalTo(64); make.top.mas_equalTo(64);
make.bottom.mas_equalTo(0); make.bottom.mas_equalTo(0);
}]; }];
__weak __typeof(self)weakSelf = self; __weak __typeof(self)weakSelf = self;
if (_needHeaderRefresh) { if (_needHeaderRefresh) {
_table.mj_header = [GMRefreshHeader headerWithRefreshingBlock:^{ _table.mj_header = [GMRefreshHeader headerWithRefreshingBlock:^{
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
[weakSelf footerRereshing]; [weakSelf footerRereshing];
}]; }];
} }
//获取数据 //获取数据
if (_immediateLoad) { if (_immediateLoad) {
[self loadRemoteData]; [self loadRemoteData];
...@@ -83,7 +83,7 @@ ...@@ -83,7 +83,7 @@
[self.viewModel setStartNum:0]; [self.viewModel setStartNum:0];
[[self.viewModel dataArray] removeAllObjects]; [[self.viewModel dataArray] removeAllObjects];
[_table reloadData]; [_table reloadData];
[self loadRemoteData]; [self loadRemoteData];
} }
...@@ -117,7 +117,7 @@ ...@@ -117,7 +117,7 @@
} }
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{ - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
if (tableView.rowHeight > 0) { if (tableView.rowHeight > 0) {
return tableView.rowHeight; return tableView.rowHeight;
}else{ }else{
...@@ -138,7 +138,7 @@ ...@@ -138,7 +138,7 @@
} }
- (void)configDataForCell:(id)cell atIndexPath:(NSIndexPath *)indexPath { - (void)configDataForCell:(id)cell atIndexPath:(NSIndexPath *)indexPath {
} }
#pragma mark - MJRefresh Delegate #pragma mark - MJRefresh Delegate
...@@ -180,14 +180,14 @@ ...@@ -180,14 +180,14 @@
}else{ }else{
[self showEmptyView:GMEmptyViewTypeException]; [self showEmptyView:GMEmptyViewTypeException];
} }
if (_table!=nil) { if (_table!=nil) {
[_table reloadData]; [_table reloadData];
[_table.mj_header endRefreshing]; [_table.mj_header endRefreshing];
[_table.mj_footer endRefreshing]; [_table.mj_footer endRefreshing];
} }
[self updateOtherUIData]; [self updateOtherUIData];
} }
} }
...@@ -200,6 +200,22 @@ ...@@ -200,6 +200,22 @@
} }
} }
- (void)showEmptyView:(GMEmptyViewType)type {
[super showEmptyView:type];
if (self.emptyView.superview != nil) {
[self.emptyView mas_remakeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(0);
make.right.mas_equalTo(0);
if (_table != nil) {
make.top.equalTo(_table.mas_top);
} else {
make.top.mas_equalTo(0);
}
make.bottom.mas_equalTo(0);
}];
}
}
#pragma mark - GMEmptyView #pragma mark - GMEmptyView
- (void)emptyViewDidClickReload { - (void)emptyViewDidClickReload {
[self loadRemoteData]; [self loadRemoteData];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment