Mugunth
Mugunth

Reputation: 14499

UITableView doesn't scroll when number of items is less than scrollable limit

I've a UITableView and I populate data from a service. When the number of rows is higher than what could be displayed on the screen, I'm able to scroll the table. But when it's less (say 1 or 2), I'm unable to scroll (in the sense, the bouce effect doesn't work making the UI appear odd).

I think this should be fixed by some IB checkbox, but not sure how to do it. Anyone faced this issue before?

Upvotes: 0

Views: 1112

Answers (3)

James Huddleston
James Huddleston

Reputation: 8448

The solution that worked for me was to set bounces to YES programmatically in viewDidLoad.

I also have bounces set to YES using the checkbox in IB. It does appear to be taking the IB value because bouncing will work after I've pushed another view controller onto the navigation controller stack and then popped it back off. However, bouncing won't work when the table view first appears unless I set bounces to YES in viewDidLoad.

Upvotes: 2

Andrei Stanescu
Andrei Stanescu

Reputation: 6383

Do you have this table view as a cell inside another table view?

Upvotes: 0

Shaggy Frog
Shaggy Frog

Reputation: 27601

Click on the table view and look at the Attributes Inspector. There's a checkbox for Bounce Scroll. (I just tested this in a project that had a 2-line table; disabling it prevented scrolling, enabling it allows the short table to bounce)

I think the programatic equivalent is the bounces property.

Upvotes: 0

Related Questions