Amnell/APParallaxHeader

iPhone 6 and iPhone 6 + Sizing

Opened this issue · 7 comments

I'm having trouble getting the parallax view to have the correct width on iPhone 6 and 6+ any help would be great.

Have you figured out any fixes for this?

It looks like initial bounds of TableView are same as designed in IB. After re-layout numbers become correct. I used something like that in VC:

- (void)viewWillLayoutSubviews {
    [super viewWillLayoutSubviews];
    CGRect rect = self.tview.parallaxView.frame;
    rect.size.width = self.view.frame.size.width;
    self.tview.parallaxView.frame = rect;
}

However, the problem I found on iOS8 is that parallax header height is increased by height of navigation bar and status bar (+64 pts).

I'm having the same issue @tomekc with the navigation and status bar. Couldn't figure out a fix yet.
Can anyone help?

APParallaxView *parallaxView = [[APParallaxView alloc] initWithFrame:CGRectMake(0, 0, self.bounds.size.width, height)];

could do with being:

APParallaxView *parallaxView = [[APParallaxView alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth([UIScreen mainScreen].bounds), height)];

or creating layout constraints to be same width as superview. right now it seems as if the auto generated constraints are by width rather that leading & trailing constraints to the superview.

or:
[parallaxView setAutoresizingMask:UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight];
before adding: [self addSubview:parallaxView]

Having the same issue with an iPhone 6 on iOS 8. Tried @markst 's suggestions but I'm still seeing the issue. Anyone figured out a fix? Alternatively, anyone know of a good alternative library?

ofawx commented

Was also having problems with the navigation and status bar in iOS7+, just found a workaround by making the bottom of the navigation bar the top of the view, by placing the following in the View Controller:

ObjC:

self.edgesForExtendedLayout = UIRectEdgeNone;

Swift:

self.edgesForExtendedLayout = UIRectEdge.None