amnell / apparallaxheader Goto Github PK
View Code? Open in Web Editor NEWCategory that makes it super easy to add a parallax effect to your UIScrollView/UITableView
License: MIT License
Category that makes it super easy to add a parallax effect to your UIScrollView/UITableView
License: MIT License
very good,if i use it with view,can i make the view bigger when i pull down?
When I use a UIScrollView for addParallaxWithView:
It doesn't scroll with the main view.
Any solution ?
UIScrollView *scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0,0,320,160)];
scrollView.contentSize = CGSizeMake(320, 170);
scrollView.showsHorizontalScrollIndicator = YES;
scrollView.showsVerticalScrollIndicator = NO;
scrollView.pagingEnabled = true;
scrollView.scrollEnabled = true;
scrollView.backgroundColor = [UIColor blueColor];
scrollView.tag = 9999;
scrollView.delegate = self;
UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Rover.jpg"]];
[imageView setFrame:CGRectMake(0, 0, 320, 160)];
[imageView setContentMode:UIViewContentModeScaleAspectFill];
[scrollView addSubview:imageView];
[_collectionView addParallaxWithView:scrollView andHeight:160];
This library has support for iPad?
Some times it's not working with iPad
Image zoom not working properly in iPad.
Can anyone help in out?
Can you please add a version for nib (xib) usage?
I use addParallaxWithView to a UIImageView
How can I add some padding on the top and bottom of the UIImageView and still get the parallax effect?
help me
I'm trying to change the top view to full size after the user scroll down some points. The method (void)scrollViewDidScroll:(CGPoint)contentOffset help me to get the scroll point, but I cannot get the table from here to change it y origin and automatically change the size of the top view.
Can you help me?
I'm having trouble getting the parallax view to have the correct width on iPhone 6 and 6+ any help would be great.
Hi !!
Thank you for given great lib. I need to set a image on header as like fb or twitter ? please help me.
When I push my TableViewController (that has a ParallaxHeader) from the didSelectRowAtIndexPath method of my search results table view (that is using UISearchDisplayController) the ParallaxHeader is hidden. This only happens with iOS 7.
Pushing my TableViewController from a regular view controller, everything's fine. So it seems like it has something todo with the SearchDisplayController and iOS 7.
MyTableViewControllerWithParallax *myVC = [[MyTableViewControllerWithParallax alloc] init];
[self.navigationController pushViewController:myVC animated:YES];
Hi apping,
In the Test, when hide keyboard, you can scroll the contentview up/down freedom. But, when show keyboard, the contentview will have more height. How can fixed this issue, thanks.
Test.zip
Scrolling the tableview up leaves the section header at the bottom of the frame of the header and doesn't scroll along with the tableview. Is this fixable?
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.
I've tried a couple of solutions to create a mask with this one as the most easiest: http://stackoverflow.com/questions/2776747/masking-a-uiimage
However it seems that the image on the tableview header isn't responsive to this solution.
I understand its not an issue, but maybe a feature for later updates. I feel that adding multiple labels would be very beneficial for this category to have.
Is there an easy way to detect tap on the UIImageView to trigger a modal view? That would be awesome!
Hi,
if I add the ParallaxHeader, the default function scrollToRowAtIndexPath does not work probably anymore.
Do u know how can I fix that?
If I want to make an custom view and add it to the top of table using the same effect what i need to change ??
I'm tried to change the meathod that take UIImage to UIView & change the Implementation for APParallax UIImageView to UIView then try to pass view to method and add as supView , but no luck :(
I am using below code to add a UIView with an UIImageView inside, next I would like to add a scrollview instead. But when you add the Image as the subView of UIView the Parallax does not work.
UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 160)];
[view setAutoresizingMask:UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight];
UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"ParallaxImage"]];
[imageView setFrame:CGRectMake(0, 0, self.view.frame.size.width, 160)];
[imageView setContentMode:UIViewContentModeScaleAspectFill];
[imageView setAutoresizingMask:UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight];
[view addSubview:imageView];
[self.tableView addParallaxWithView:view andHeight:160];
Any ideas?
Thanks for a great control.
Its got some images and some labels, will it be possible to do with storyborad,
I am using Xcode 7 and swift 2
i am using the APParallaxHeader in a Modal View which is resizeable. i figured out that the image does not resize but the APParallaxView does. So, easy fix for that is to set the autoresizingMask of imageView to the following in line 196:
[self.imageView setAutoresizingMask:UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight];
and also in line 189 set the autoresizingmask for self:
[self setAutoresizingMask:UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight];
Example code:
func getPhoto(callback: (Array<AnyObject>) -> ()) {
let urlPath: NSString = "some_rest_url"
let url = NSURL(string: urlPath)
let request = NSMutableURLRequest(URL: url)
request.HTTPMethod = "GET"
request.addValue("application/json", forHTTPHeaderField: "Accept")
let session = NSURLSession(configuration: NSURLSessionConfiguration.defaultSessionConfiguration(), delegate: self, delegateQueue: NSOperationQueue.mainQueue())
var dataTask = NSURLSessionDataTask()
dataTask = session.dataTaskWithRequest(request) { (data, response, error) in
if (error == nil) {
callback(array)
}
}
dataTask.resume()
}
override func viewDidLoad() {
super.viewDidLoad()
// Works fine here with any image.
//let venueImage = UIImage(named: "bg")
//self.tableView.addParallaxWithImage(venueImage, andHeight: 160)
// Bug occurs here, when coming from callback.
api.getPhoto() { (photos) in
let photo = photos[0] as FSPhoto
let data = NSData(contentsOfURL: NSURL.URLWithString("\(photo.prefix)300x300\(photo.suffix)"))
let venueImage = UIImage(data: data)
let venueImage = UIImage(named: venueImage)
self.tableView.addParallaxWithImage(venueImage, andHeight: 160)
}
}
First Load (from callback method):
When scrolling for the first time (either up or down), the image appears where it should be.
The image appears properly otherwise if it's just a simple call within the viewDidLoad
.
We are using APParallaxHeader at multiple places in our app so far it was working great but with a one particular table view which has various sections it's not doing great it feels a glitch in scrolling sometimes and while pulling down the header a black background shows up in the background of header bottom part.
Any news regarding this feature ?
I would like to use this parallax view with a text inside...
Once I add the Custom View to the TableView is there a way to Remove the Parallax View?
Thanks
Can you make a new release on CocoaPods? Previous releases don't support parallax views on iPhone 6 and iPhone 6+.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.