Amnell/APParallaxHeader

Image is not displaying (White blank space)?

Closed this issue · 3 comments

vicc commented

I currently have a view controller embedded in a navigation view controller. I added a tableview in storyboard, and connected it to my view. I then added the following line to my viewDidLoad method: [self.menuTableView addParallaxWithImage:[UIImage imageNamed:@"ParallaxImage.jpg"] andHeight:160]; and imported the image, but all I get is a blank white space where the image should be. menuTableView is the tableView that I'm working with.

Any idea why it isn't loading the image? I imported the library using cocoapods and imported the header file into my viewcontroller.

screen shot 2013-05-22 at 11 08 04 pm

Are you sure your image really exists? For debugging you could try [UIImage imageWithName:@"Default"] or some other image that you are sure exists and should load correctly.

vicc commented

UPDATE: Actually I figured out the problem. It turns out that my tableview was stored inside a view within my navigationViewController. As soon as I deleted the view and placed the tableview right beneath my home view controller, it solved the problem.

problemfixed

Glad it worked out for you.

Found the bug. I think it is due to autolayout. Without autolayout it will work just fine, and with it you will have to put [self.menuTableView addParallaxWithImage:[UIImage imageNamed:@"ParallaxImage.jpg"] andHeight:160]; in viewDidLayoutSubviews