Comments (5)
In the Gemr app I had to do some internal customization to achieve that effect.
In a nutshell, the individual pages have clear backgrounds, and the onboarding view controller itself has multiple image views as the background, with images for each page. Using the scrollViewDidScroll:(UIScrollView *)scrollView
delegate method, I'm able to determine the amount the page view controller has scrolled and fade in/out the associated image views and the contents of each page... Something like the following is what I did in objective-c:
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
// calculate the percent complete of the transition of the current page given the
// scrollview's offset and the width of the screen
CGFloat percentComplete = fabs(scrollView.contentOffset.x - self.view.frame.size.width) / self.view.frame.size.width;
// these cases have some funky results given the way this method is called, like stuff
// just disappearing, so we want to do nothing in these cases
if (_upcomingPage == _currentPage || percentComplete == 0) {
return;
}
_currentImageView.alpha = 1.0 - percentComplete;
_upcomingImageView.alpha = percentComplete;
// set the next page's alpha to be the percent complete, so if we're 90% of the way
// scrolling towards the next page, its content's alpha should be 90%
[_upcomingPage updateAlphas:percentComplete];
// set the current page's alpha to the difference between 100% and this percent value,
// so we're 90% scrolling towards the next page, the current content's alpha should be 10%
[_currentPage updateAlphas:1.0 - percentComplete];
}
Out of the box Onboard doesn't support this, but that should give you a baseline to look into customizing yourself.
Thanks!
from onboard.
Thanks, that really help me a lot. Just one more question, in the case of adding a button like Gemr app how do you implement It, cause Im trying to make the page control smaller so I can add a button but still I cant find where .
Thanks in advance
from onboard.
That was done the same way and in the same place where the skip button was added, internally inside OnboardingViewController. Those buttons sit on top of everything so they don't scroll or fade in/out.
from onboard.
your adding subview how can i change in backgroundImageView with subview what does it means when your saying has multiple image views as the background how you have done that????
thanks
from onboard.
@chitaranjan I created a subclass of Onboard where you can fade the background in and out. It's here
You'll have to hard code the number of images, and I am still working on making this subclass "better," but it gets the job done.
from onboard.
Related Issues (20)
- Change title of skip button HOT 1
- Crash if canceling a catch
- Skip Button not centralized in page control
- Multiple action buttons
- Open Onboard directly in storyboard HOT 2
- How change background image content mode?
- Changing Skip Button Size
- Dots don't show
- How to disable the onboardingViewController`s bounce
- iPhone X Support? HOT 6
- Project Continuity HOT 5
- How to hide a skip button in the last page? HOT 1
- How to change background image for every page ? HOT 1
- how to maintain the view of tab bar in the bottom?
- How can I add button right next to action button ?
- The picture has shifted downward.
- Use of '@import' when C++ modules are disabled, consider using -fmodules and -fcxx-modules @import AVKit;error
- Direct error reporting from import framework:Use of '@import' when C++ modules are disabled, consider using -fmodules and -fcxx-modules
- After adding, run the program and start the page black screen
- Why In my project, the images didn't fill the entire screen
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from onboard.