0

I've created a UITableVIew and it is a subview of a UIView. There are three issues that i'm having and it is only occurring on iOS 4 devices:

1) The table doesn't bounce when the view hits either the top or bottom of the table while scrolling. The vertical bar doesn't shrink either, it feels sticky and it is very much acting like an Android table view. I've tried enabling the bounce property but that doesn't make any difference.

2) The horizontal scroll bar appears when the view is scrolled down to the bottom of the table. This shouldn't appear since the table view's contentSize has been set correctly. It does eventually disappear when the contentSize is set 20 pixels less than what it should be.

3) I can't scroll to the bottom of the footer view, and only half the footer view is visible.

I've added a UITableView as a subview to other views throughout my project and this has never occurred, and so i've copied the way that I create other UITableViews, but still no luck.

Any suggestions would be greatly appreciated.

Thanks, Ankur

Ankur22
  • 103
  • 3
  • 10

1 Answers1

0

I worked out the problem. The problem is a little strange, although i had a feeling that the way i was coding was a little messy.

I am subclassing a View, and the parent view has a layoutSubview method, which is only calculating and setting the frame for a table view subview. In the subclass, i had to override layoutSubview for the same reason as the values for the table view's frame need to be different. This means that the table view's frame was being laid out twice, once by the parent class and a second time by the subclass. It seems that iOS 4 doesn't like this, and i should only set the frame once per subview per layoutSubview call.

Now i've created a layoutTableView method, which is called from the parents layoutSubview, and i've overridden layoutTableView in the subclass. Therefore the table view's frame is only being set once.

Ankur22
  • 103
  • 3
  • 10