Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions APParallaxHeader/UIScrollView+APParallaxHeader.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
- (void)addParallaxWithImage:(UIImage *)image andHeight:(CGFloat)height andShadow:(BOOL)shadow;
- (void)addParallaxWithImage:(UIImage *)image andHeight:(CGFloat)height;
- (void)addParallaxWithView:(UIView*)view andHeight:(CGFloat)height;
- (void)addParallaxWithView:(UIView*)view andHeight:(CGFloat)height andShadow:(BOOL)shadow;

@property (nonatomic, strong, readonly) APParallaxView *parallaxView;
@property (nonatomic, assign) BOOL showsParallax;
Expand Down
6 changes: 5 additions & 1 deletion APParallaxHeader/UIScrollView+APParallaxHeader.m
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,18 @@ - (void)addParallaxWithImage:(UIImage *)image andHeight:(CGFloat)height andShado
}

- (void)addParallaxWithView:(UIView*)view andHeight:(CGFloat)height {
[self addParallaxWithView:view andHeight:height andShadow:YES];
}

- (void)addParallaxWithView:(UIView*)view andHeight:(CGFloat)height andShadow:(BOOL)shadow {
if(self.parallaxView) {
[self.parallaxView.currentSubView removeFromSuperview];
[view setAutoresizingMask:UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight];
[self.parallaxView setCustomView:view];
}
else
{
APParallaxView *parallaxView = [[APParallaxView alloc] initWithFrame:CGRectMake(0, 0, self.bounds.size.width, height)];
APParallaxView *parallaxView = [[APParallaxView alloc] initWithFrame:CGRectMake(0, 0, self.bounds.size.width, height) andShadow:shadow];
[parallaxView setClipsToBounds:YES];

[parallaxView setCustomView:view];
Expand Down
2 changes: 1 addition & 1 deletion Demo/APParallaxHeaderDemo/MasterViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell" forIndexPath:indexPath];

cell.textLabel.text = [NSString stringWithFormat:@"Row %i", indexPath.row+1];
cell.textLabel.text = [NSString stringWithFormat:@"Row %li", indexPath.row+1];
return cell;
}

Expand Down