UITableView和UIScrollView共存,滚动条滚动问题。UIScrollView中放了一个UITableView,两个滚动条会冲突,我的解决方法是把UITableView中的scrollView Enabled禁止掉。只让UIScrollView可以滚动,然后动态计算UITableView中cell的高度*行数。这是UITableView的高度就行了。UIScrollView也一样动态计算设置
应用场景
[_scrollView setContentSize:CGSizeMake(320, (65*[data count])+160)];
应用场景
SGFocusImageFrame *imageFrame = [[SGFocusImageFrame alloc] initWithFrame:CGRectMake(0, 0, self.view.bounds.size.width, 160.0) delegate:self items:a];
[_scrollView addSubview:imageFrame];
[_tableView reloadData];
[_tableView setFrame:CGRectMake(_tableView.frame.origin.x, _tableView.frame.origin.y, _tableView.frame.size.width, _tableView.frame.size.height+(65*[data count]))];
[_scrollView setContentSize:CGSizeMake(320, (65*[data count])+160)];
UIView *footer =[[UIView alloc] initWithFrame:CGRectZero];
_tableView.tableFooterView = footer;