美文网首页
IQKeyboardManager 解决解盘遮挡问题

IQKeyboardManager 解决解盘遮挡问题

作者: 寂寞先森666 | 来源:发表于2019-07-18 11:23 被阅读0次
#import "ViewController.h"
#import "IQKeyboardManager/IQKeyboardManager.h"
#import "sbTableViewCell.h"
@interface ViewController ()<UITableViewDelegate,UITableViewDataSource>
@property(strong,nonatomic)UITableView * tableView;
@end

@implementation ViewController
-(UITableView *)tableView
{
    if (!_tableView) {
        _tableView = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height) style:0];
        _tableView.delegate = self;
        _tableView.dataSource = self;
        [_tableView registerNib:[UINib nibWithNibName:@"sbTableViewCell" bundle:[NSBundle mainBundle]] forCellReuseIdentifier:@"sbTableViewCell"];
    }
    return _tableView;
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 50;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    sbTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:@"sbTableViewCell"];
    return cell;
}
- (void)viewDidLoad {
    [super viewDidLoad];
    [IQKeyboardManager sharedManager].enable = YES;
    
    [self.view addSubview:self.tableView];
}


@end
屏幕快照 2019-07-18 上午11.19.58.png

相关文章

网友评论

      本文标题:IQKeyboardManager 解决解盘遮挡问题

      本文链接:https://www.haomeiwen.com/subject/xniklctx.html