ASP源码.NET源码PHP源码JSP源码JAVA源码DELPHI源码PB源码VC源码VB源码Android源码
当前位置:首页 >> 低调看直播体育app软件下载 >> IOS开发 >> iOS聊天界面cell从下至上滚动

iOS聊天界面cell从下至上滚动(1/2)

来源:网络整理     时间:2016-04-06     关键词:cell,IOS

本篇文章主要介绍了"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

  • (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
    {
    return self.dataSoure.count;
    }

相关图片

相关文章