I think this may work for you. Run this code after calling reloadData
on the table :
if (table.contentSize.height < table.frame.size.height)
{
table.scrollEnabled = NO;
}
else
{
table.scrollEnabled = YES;
}
Here ,table.frame.size.height
is the actual size of the object (you can see this in Interface Builder) displayed on the screen, whereas table.contentSize.height
is the height of the header
, the footer
, and the height of every cell
added together.
I found it here : How to disable scrolling in UITableView table when the content fits on the screen
Hope you can get something from the answers given their also.