本篇文章主要介绍了"iOS聊天界面cell从下至上滚动",主要涉及到cell,IOS方面的内容,对于IOS开发感兴趣的同学可以参考一下:
import "ChatView.h"import "ChatCell.h"@interface ChatView () @property (nonatomi...
import "ChatView.h"
import "ChatCell.h"
@interface ChatView ()
@property (nonatomic, strong) NSMutableArray dataSoure;
@property (nonatomic, strong) UITableView tableView;
@end
@implementation ChatView
(instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
self.backgroundColor = [UIColor clearColor];
self.dataSoure = [NSMutableArray array];
self.tableView = [[UITableView alloc]initWithFrame:self.bounds];
_tableView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
_tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
_tableView.showsVerticalScrollIndicator = NO;
_tableView.backgroundColor = [UIColor clearColor];
_tableView.delegate = self;
_tableView.dataSource = self;
_tableView.transform = CGAffineTransformMakeScale(1, -1);
[self addSubview:self.tableView];
}
return self;
}
(void)reloadData
{
[self.tableView reloadData];
[self.tableView scrollRectToVisible:CGRectMake(0, 0, 1, 1) animated:YES];
}
pragma mark - UITableViewDelegate && UITableViewDataSource