简体   繁体   中英

UITableView Scrolling Horizontal issue

this is my code for creating tableView :

 _tableView = [[UITableView alloc] initWithFrame:CGRectMake(8, 0, self.view.frame.size.width - 16, self.view.frame.size.height - 8) style:UITableViewStylePlain];

        [_tableView registerNib:[UINib nibWithNibName:@"commentCell" bundle:nil] forCellReuseIdentifier:@"commentCell"];
        _tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
        _tableView.backgroundColor = [UIColor groupTableViewBackgroundColor];

        _tableView.dataSource = self;
        _tableView.delegate = self;

        [self.view addSubview:_tableView];

the Problem is that my table is scrolling horizontally I need to know how to deactivate it, I've tried bounce = NO; or contentSize but always same issue my table still allow scrolling horizontally 在此处输入图片说明

问题是由我的viewDidAppear中的[tableView reaload]函数引起的,该函数在完成显示allCell之前重新加载了我的表,因此导致了不适当的行为

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM