Framework Onboard-guide page style creation library, framework onboard-style

Source: Internet
Author: User

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/


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.