Giter Site home page Giter Site logo

a3parallaxscrollview's People

Contributors

yinkou avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

a3parallaxscrollview's Issues

Problem with UIView beginAnimations

Hi,

I used your library, but when I add an animation on the UIScrollView, I have a problem with the position of the viewBackground ?

My code :

-(void)viewWillAppear:(BOOL)animated {

[super viewWillAppear:animated];

[self.viewContent setFrame:CGRectMake(0.0, 0.0, self.viewContent.frame.size.width, self.view.frame.size.height)];
[self.viewBackground setFrame:CGRectMake(0.0, 0.0, self.viewBackground.frame.size.width, self.view.frame.size.height)];

[self.scrollView setContentSize:CGSizeMake(self.viewContent.frame.size.width, self.view.frame.size.height)];
[self.scrollView addSubview:self.viewBackground withAcceleration:CGPointMake(0.5, 1.0)];
[self.scrollView addSubview:self.viewContent withAcceleration:A3DefaultAcceleration];

}

-(void)viewDidAppear:(BOOL)animated {

[super viewDidAppear:animated];

[UIView beginAnimations:@"A3Animation" context:nil];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
[UIView setAnimationDelay:0.5];
[UIView setAnimationDuration:1];

[self.scrollView setContentOffset:CGPointMake(self.view.frame.size.width, 0.0)];

[UIView commitAnimations];

}

Suggestion to fix autolayout crashes

replace the layoutsubvies with this:

  - (void)layoutSubviews{
        [super layoutSubviews];


    for (UIView *v in self.subviews) {
        // get acceleration
        CGPoint accelecration = [self accelerationForView:v];

        // move the view
        [v.layer setAffineTransform:CGAffineTransformMakeTranslation(self.contentOffset.x*(1.0f-accelecration.x), self.contentOffset.y*(1.0f-accelecration.y))];
         }
    }

I can do a pull request if you want?

Add a method to get a view's adjusted contentOffset

Hi,

The contentOffset of a parallaxed SubView will be transformed depending of the acceleration.

It would be good to have a methd like this:

  • (CGPoint) adjustedContentOffsetForView:(UIVIew *)view;

And it would return the adjusted ContentOffset for that view
Something like:
self.contentOffset * Acceleration (X and Y)
or just:
subview.transform. (Tx and tY)

What do you guys think?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.