tommi
tommi

Reputation: 6973

Unable scroll to lower portion of UITableView which is added as a subview inside a UIView

I'm not sure what is happening to my UITableView.

Right now, the UITableView is added as a subview.

And when the content in my tableview becomes larger than the view, I'm expecting the tableview to be scrollable.

But what is happening is that whenever the table view is scrolled beyond bottom of the UIView, it will be bouncing back.

I tried to manually calculate the content size of the table view but it is not working so I assume that is not a right way.

Upvotes: 1

Views: 804

Answers (4)

SentineL
SentineL

Reputation: 4732

your table view rect is lager then your view's rect. just make it smaller. EDIT: some times it happends, when you have navigation bar, or tabbar. Your view automatically resized, but not allways as you whant. In this case, you have 2 options:

  1. lasy: resize/replase all necessary objects of your view in -(void)viewWillAppear method.
  2. Confogure resizing rules in interface builder. For more details about this, look at my answer for this question: Objective C: Adaptive Toolbar

Upvotes: 2

Johnykutty
Johnykutty

Reputation: 12829

Try to set the the frame of your tableview which must be inside the parent view

Upvotes: 0

aViNaSh
aViNaSh

Reputation: 1328

I think the frame of table view is not properly set .

Upvotes: 1

MatLecu
MatLecu

Reputation: 953

Usually this happens when your UITableView is bigger than its parent view. Make sure the lower bound of your tableWiew is in the parent UIView.

Upvotes: 0

Related Questions