Framework Onboard-guide page style creation library, framework onboard-style
Set the background image or background movie, and then generate several viewcontrollers on them. The default is the top image. The title and details are shown below, and the buttons and pages are shown at the bottom.
Github address https://github.com/mamaral/Onboard
Procedure:
1. import the header file: # import "OnboardingViewController. h"
2. Create a controller-OnboardingContentViewController and add various elements to the Controller.
OnboardingContentViewController * firstVc = [OnboardingContentViewController contentWithTitle: @ "first page" body: @ "This is the first image" image: [UIImage imageNamed: @ "guidepage01"] buttonText: @ "Click 1" action: ^ {NSLog (@ "click the first image");}]; OnboardingContentViewController * secondVc = [OnboardingContentViewController contentWithTitle: @ "second page" body: @ "this is the second image" image: [UIImage imageNamed: @ "guidepage02"] buttonText: @ "2" action: ^ {NSLog (@ "click the second image") ;}]; OnboardingContentViewController * thirdVc = [OnboardingContentViewController contentWithTitle: @ "Third page" body: @ "this is the third chapter image" image: [UIImage imageNamed: @ "guidepage03"] buttonText: @ "point 3" action: ^ {NSLog (@ "Click Chapter 3");}];
Where:
- Title is the title
- Body is a text description
- Image is the top image
- ButtonText is the button name
- Action is the callback of the event block when a button is clicked.
3. Create a background image controller-OnboardingViewController. Add the created controller.
OnboardingViewController *onboardingVC = [OnboardingViewController onboardWithBackgroundImage:[UIImage imageNamed:@"guidepage04"] contents:@[firstVc,secondVc,thirdVc]];
4. Adjust the overall effect
// Blur the image (pretty) onboardingVC. shouldBlurBackground = YES; // you can add the fade-out effect to the text on the mask: onboardingVC. shouldFadeTransitions = YES; // font style onboardingVC. fontName = @ "Helvetica-Light"; // Title font size-> parameter: contentWithTitle onboardingVC. titleFontSize = 22; // description text font size-> parameter: body onboardingVC. bodyFontSize = 50; // OnboardingContentViewController-> parameter: onboardingVC of the image. topPadding = 20; // OnboardingContentViewController-> parameter: onboardingVC. underIconPadding = 20; // OnboardingContentViewController-> parameter: onboardingVC, the position of the body at the top of the screen. underTitlePadding = 20; // OnboardingContentViewController refers to-> parameter: the distance between buttonText and the onboardingVC at the bottom of the screen. bottomPadding = 400;
// Whether to display pageController (that is, the counting point...). The default value is NO onboardingVC. hidePageControl = YES; // whether to slide (YES by default) onboardingVC. swipingEnabled = YES; // callback block secondVc. viewDidAppearBlock = ^ {NSLog (@ "Controller will be displayed soon... ");};
SecondVc. viewDidDisappearBlock = ^ {
NSLog (@ "the controller is about to disappear ..");
};
// Click the button event-> whether to directly jump to the next controller secondVc. movesToNextViewController = YES;
The above sorting reference --> http://www.ios122.com/2015/11/onboard/