After the UITableView with ios on UIScrollview has added tabheaderview, the bottom cell cannot scroll to

problem description

I"m doing an APP setup interface, with a UIView at the top, followed by a set of Tableview. I wanted UIView to scroll with UITableView, so I added UIView as the head view of UITableView. After the addition is successful, the bottom cell of TableView cannot be scrolled, and the display is incomplete. Everything is fine without adding UIVide

the environmental background of the problems and what methods you have tried

I tried to resize the content view of UIScrollView and found it didn"t work.

related codes

/ / Please paste the code text below (do not replace the code with pictures)

-(void)loadUserInterFaceView{
_userInter = [[UIView alloc]initWithFrame:CGRectMake(0, 0, VCSelfWidth, 100)];
_userInter.backgroundColor = [UIColor whiteColor];
[_scrollview addSubview:_userInter];
_tableView.tableHeaderView = _userInter;
UITapGestureRecognizer *tapGesturRecognizer=[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(tapAction:)];
[_userInter addGestureRecognizer:tapGesturRecognizer];
} //_userInter,100;


-(void)initTableview{
_tableView=[[UITableView alloc]initWithFrame:self.view.bounds style:UITableViewStylePlain];
_tableView.backgroundColor=axbackgrond;
_tableView.frame=CGRectMake(0,0,VCSelfWidth,VCSelfHeight);
_tableView.dataSource=self;
_tableView.delegate=self;
_tableView.scrollEnabled =YES;
[self loadUserInterFaceView];
[_tableView addSubview:_userInter];
_tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
_items = [NSArray arrayWithObjects:@"",@"",@"",@"",@"",@"",@"",@"",@"", nil];

}
-(void) loadScrollerView {

_scrollview = [[UIScrollView alloc]initWithFrame:CGRectMake(0, 64, VCSelfWidth, VCSelfHeight-64)];//64UINavgitaionController
_scrollview.backgroundColor = [UIColor whiteColor];
_scrollview.bounces = YES;
_scrollview.scrollsToTop = YES;
_scrollview.contentSize = CGSizeMake(VCSelfWidth,100+70*9);
_scrollview.scrollEnabled =  YES;
_scrollview.showsVerticalScrollIndicator = NO;
[self.view addSubview:_scrollview];
[self initTableview];
[_scrollview addSubview:_tableView];

}

  • (NSInteger) numberOfSectionsInTableView: (UITableView *) tableView {
    return 1;
    }
  • (NSInteger) tableView: (UITableView *) tableView numberOfRowsInSection: (NSInteger) section {
    return _ items.count;
    }
  • (CGFloat) tableView: (UITableView ) tableView heightForRowAtIndexPath: (NSIndexPath ) indexPath {
    return 70;
    }

what result do you expect? What is the error message actually seen?

I increased the contentSize height of UIScroller by 100, that is, the height of UIView, why scrolling to the bottom appears in the middle of the penultimate cell. The last cell cannot be displayed

Jun.13,2022

although the answer is too late, I still point out the question:
if you mistakenly added headerView to the scrollView, this line of code should be deleted:

[_scrollview addSubview:_userInter];
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e730e4-42b.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e730e4-42b.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?