| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- //
- // MOGuildStartView.m
- // MiMoLive
- //
- // Created by SuperC on 2023/10/25.
- //
- #import "MOGuildStartView.h"
- #import "MOGuildStartCell.h"
- @implementation MOGuildStartView
- - (instancetype)initWithFrame:(CGRect)frame style:(UITableViewStyle)style
- {
- self = [super initWithFrame:frame style:style];
- if (self)
- {
- self.delegate = self;
- self.dataSource = self;
- self.estimatedRowHeight = 0;
- self.estimatedSectionHeaderHeight = 0;
- self.estimatedSectionFooterHeight = 0;
-
- //iOS15适配
- if (@available(iOS 15.0, *))
- {
- self.sectionHeaderTopPadding = 0;
- }
- self.backgroundColor = [MOTools colorWithHexString:@"#F5F1F6" alpha:1.0];
- self.contentInset = UIEdgeInsetsMake(0, 0, 0, 0);
- [self registerNib:[UINib nibWithNibName:@"MOGuildStartCell" bundle:nil] forCellReuseIdentifier:MOGuildStartCell_ID];
- }
- return self;
- }
- - (void)setDataArr:(NSMutableArray *)dataArr{
- _dataArr = dataArr;
- [self reloadData];
- }
- - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
- {
- return self.dataArr.count;
- }
- - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
- {
- return 1;
- }
- - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
-
- MOGuildBase *model = self.dataArr[indexPath.section];
- MOGuildStartCell *cell = [tableView dequeueReusableCellWithIdentifier:MOGuildStartCell_ID];
-
- cell.model = model;
- return cell;
- }
- - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
- [tableView deselectRowAtIndexPath:indexPath animated:YES];
- }
- - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
-
- return 0.01;
- }
- - (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
- return 10.0;
- }
- - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
- UIView *view = [[UIView alloc] init];
- view.backgroundColor = [UIColor clearColor];
- return view;
- }
- - (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section{
- UIView *view = [[UIView alloc] init];
- view.backgroundColor = [UIColor clearColor];
- return view;
- }
- @end
|