2

I have a an app in IOS 6. Now i am try to make it compatible with IOS 7.

I have a search bar controller. All works good in IOS 6. I have used UISearch Display Controller.

But in IOS 7 content size of table view not set correctly.

While i dont search any thing :

enter image description here

But if i search any anything than click on list view and scroll i have this out put :

![enter image description here][2]

You can see the white space below.

- (NSInteger)tableView:(UITableView *)tableView1 sectionForSectionIndexTitle:(NSString *)title atIndex:(NSInteger)index {
if (title == UITableViewIndexSearch) {
            [tblData scrollRectToVisible:self.searchDisplayController.searchBar.frame animated:NO];
            return -1;
        }
}

enter image description here

Thanks for Help

Priyank Gandhi
  • 1,257
  • 1
  • 16
  • 29
  • After searching only the white space is coming or while launching the view itself coming? – Ganapathy Oct 03 '13 at 11:57
  • @Ganapathy The white space is coming while searching. I have full Table view but while searching its content size becoming small – Priyank Gandhi Oct 03 '13 at 12:05
  • Are you using custom cell? – Ganapathy Oct 03 '13 at 12:18
  • Refer:http://stackoverflow.com/questions/19046969/uitextview-content-size-different-in-ios7/19047167#19047167. i have posted a solution there with a link. I think your problem is similar though in that case the issue is in TextView. You need to use sizeToFit method before using contentSize in iOS7. – Puneet Sharma Oct 03 '13 at 12:19
  • @Ganapathy Yes i am using custom cell. – Priyank Gandhi Oct 03 '13 at 12:24
  • Click [here](http://stackoverflow.com/questions/19069503/uisearchdisplaycontrollers-searchresultstableviews-contentsize-is-incorrect-b/19162257#19162257?newreg=6fca5dd742e84b65904aa4ab72265882")! hope it will help you – lhmsweet Jan 07 '14 at 09:49
  • It's exactly not the same issue but might give some headway http://stackoverflow.com/questions/8789210/content-size-issue-for-uitableview-in-uiscrollview/32821375#32821375 – Abhijeet Sep 28 '15 at 11:06

1 Answers1

1

As you mentioned in the comment, you have a custom cell, maybe with custom layout and view hierarchy. Be sure to add views to the cell's contentView instead the cell, that is changed in iOS7.

Peteee24
  • 510
  • 4
  • 8