I am trying to see the whole tableview when user scrolls totally but the problem is my table isn’t getting displayed till the very bottom and bouncing somewhere before that and not showing the whole data.
Here’s the code i am using to initailze the table view :
tableView = [[UITableView alloc]initWithFrame:CGRectMake(0,0,newViewFrame.size.width,newViewFrame.size.height) style:UITableViewStyleGrouped];
tableView.delegate = self;
tableView.dataSource = self;
tableView.contentSize = CGSizeMake(newViewFrame.size.width,screenFrame.size.height*1.5);
[tableView setCanCancelContentTouches:NO];
tableView.clipsToBounds = YES; // default is NO, we want to restrict drawing within our scrollview
tableView.indicatorStyle = UIScrollViewIndicatorStyleBlack;
[tableView setScrollEnabled:YES];
[tableView setPagingEnabled:YES];
//[tableView setAlwaysBounceVertical:NO];
[tableView setShowsVerticalScrollIndicator:YES];
[self.view addSubview:tableView];
Please let me know if there is something i am doing wrong or i skipped??
Thanks,
@Ashutosh:
I feel that the issue is somewhere related with the height or contentSize of your tableView.
It should be less than or equal to the viewController’s view height. I prefer to keep it slightly less if you have a navigation controller on the same view.
And because you tableView height is more, it reaches maximum limit of the view and then bounces back.
So please try making the initial height of the tableView less than or equal to that of the main view.
EDIT:
Also try removing the statement where you specify the contentSize of the table. I think is not very much necessary to specify that.
Remove or Comment out this statement an try:
Hope this helps you.