I’m trying to add UIScrollView with paging as a header to my table, but unfortunately it is not displayed correctly.
The htableHaderView is resized to the size of my imagesScrollView, but only half of it is displayed the rest area is blank.
- (void)viewDidLoad
{
[super viewDidLoad];
ImagesViewController *imagesScrollView = [[ImagesViewController alloc] initWithNibName:@"ImagesViewController" bundle:nil];
tableView.tableHeaderView = imagesScrollView.view;
imagesScrollView = nil;
}
Thanks for helping
I tried the following code:
ViewController.h
ViewController.m
ImagesViewController.h
ImagesViewController.m
ImagesViewController‘s xib is a view, 768 wide by 200 tall (I made an iPad-basedUITableViewsingle-view application). Inside itsviewis aUIScrollView, set to take up the entire[view frame]area. Then I put aUIViewinside of it.My testing gives me a header that is an orange rectangle, and I can scroll it around as you would expect. This leads me to believe that maybe you need to check the shocks/struts of your
imagesScrollViewin Interface Builder. Make sure all of the margins and widths are fixed/flexible as you need for it to display properly.