From 7b02207537d35bfa1714bf8beafc921f717d100a Mon Sep 17 00:00:00 2001 From: 单军华 Date: Wed, 11 Jul 2018 10:47:42 +0800 Subject: [PATCH] 首次上传 --- screendisplay/screendisplay/Classes/Base/BaseControllers/LMJTableViewController.m | 87 +++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 87 insertions(+), 0 deletions(-) diff --git a/screendisplay/screendisplay/Classes/Base/BaseControllers/LMJTableViewController.m b/screendisplay/screendisplay/Classes/Base/BaseControllers/LMJTableViewController.m new file mode 100755 index 0000000..47f7443 --- /dev/null +++ b/screendisplay/screendisplay/Classes/Base/BaseControllers/LMJTableViewController.m @@ -0,0 +1,87 @@ +// +// LMJTableViewController.m +// PLMMPRJK +// +// Created by windshan on 2017/4/11. +// Copyright �� 2017��� GoMePrjk. All rights reserved. +// + +#import "LMJTableViewController.h" + +@interface LMJTableViewController () +/** <#digest#> */ +@property (nonatomic, assign) UITableViewStyle tableViewStyle; +@end + +@implementation LMJTableViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + [self setupBaseTableViewUI]; +} + +- (void)setupBaseTableViewUI +{ + self.tableView.backgroundColor = self.view.backgroundColor; + if ([self.parentViewController isKindOfClass:[UINavigationController class]]) { + UIEdgeInsets contentInset = self.tableView.contentInset; + contentInset.top += self.lmj_navgationBar.lmj_height; + self.tableView.contentInset = contentInset; + } + + // ������ ios 11 + self.tableView.estimatedRowHeight = 0; + self.tableView.estimatedSectionHeaderHeight = 0; + self.tableView.estimatedSectionFooterHeight = 0; +} + +#pragma mark - scrollDeleggate +- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView +{ + UIEdgeInsets contentInset = self.tableView.contentInset; + contentInset.bottom -= self.tableView.mj_footer.lmj_height; + self.tableView.scrollIndicatorInsets = contentInset; + [self.view endEditing:YES]; +} + +#pragma mark - TableViewDelegate +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section +{ + return 0; +} + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ + return [UITableViewCell new]; +} + +- (UITableView *)tableView +{ + if(_tableView == nil) + { + + UITableView *tableView = [[UITableView alloc] initWithFrame:self.view.bounds style:self.tableViewStyle]; + [self.view addSubview:tableView]; + tableView.delegate = self; + tableView.dataSource = self; + tableView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; + _tableView = tableView; + } + return _tableView; +} + +- (instancetype)initWithStyle:(UITableViewStyle)style +{ + if (self = [super init]) { + _tableViewStyle = style; + } + + return self; +} + +- (void)dealloc +{ + +} + +@end -- Gitblit v1.8.0