Iphone development-Implementation of the User Guide interface similar to WeChat

Source: Internet
Author: User

For user experience, most applications display a simple introduction page, that is, the user guide page, when the application is started for the first time. The following results are displayed: I tried it myself, scrollview is used to switch views. When you switch to the last view, a start button is displayed. Click the start button to close the guide. Start button click processing: [cpp]-(IBAction) startButtonDidPressed :( id) sender {[self. startButton setHidden: YES]; NSArray * array = [UIImage splitimage1_twoparts: self. imageView. image]; self. left = [[UIImageView alloc] initWithImage: [array objectAtIndex: 0]; float height = DEVICE_IS_IPHONE5? 568: 480; [self. left setFrame: CGRectMake (0, 0,320, height)]; self. right = [[UIImageView alloc] initWithImage: [array objectAtIndex: 1]; [self. right setFrame: CGRectMake (0, 0,320, height)]; [self addSubview: self. left]; [self addSubview: self. right]; [self. pageScroll setHidden: YES]; [self. pageControl setHidden: YES]; self. left. transform = CGAffineTransformIdentity; self. right. transform = CGAffineTran SformIdentity; [UIView beginAnimations: @ "split" context: nil]; [UIView Duration: self]; [UIView setAnimationDuration: 1.2]; [UIView Duration: @ selector (animationDidStop: finished: context :)]; [self. left setAlpha: 0.15]; [self. right setAlpha: 0.15]; self. left. transform = CGAffineTransformMakeTranslation (-180, 0); self. right. transform = CGAffineTransformMakeTranslation (180, 0); [UIView commitAnimations];}-(IBAction) startButtonDidPressed :( id) sender {[self. startButton setHidden: YES]; NSArray * array = [UIImage splitimage1_twoparts: self. imageView. image]; self. left = [[UIImageView alloc] initWithImage: [array objectAtIndex: 0]; float height = DEVICE_IS_IPHONE5? 568: 480; [self. left setFrame: CGRectMake (0, 0,320, height)]; self. right = [[UIImageView alloc] initWithImage: [array objectAtIndex: 1]; [self. right setFrame: CGRectMake (0, 0,320, height)]; [self addSubview: self. left]; [self addSubview: self. right]; [self. pageScroll setHidden: YES]; [self. pageControl setHidden: YES]; self. left. transform = CGAffineTransformIdentity; self. right. transform = CGAffineTran SformIdentity; [UIView beginAnimations: @ "split" context: nil]; [UIView Duration: self]; [UIView setAnimationDuration: 1.2]; [UIView Duration: @ selector (animationDidStop: finished: context :)]; [self. left setAlpha: 0.15]; [self. right setAlpha: 0.15]; self. left. transform = CGAffineTransformMakeTranslation (-180, 0); self. right. transform = CGAffineTransformMakeTranslation (180, 0); [UIView commitAnimations];} cut the last image into two parts, add an "open door Animation", and remove the image at the end of the animation: [cpp]-(void) usage :( NSString *) animationID finished :( NSNumber *) finished context :( void *) context {[[UIApplication sharedApplication] setStatusBarHidden: NO withAnimation: role]; if ([animationID isinclutostring: @ "split"] & finished) {[self. left removeFromSuperview]; [self. right removeFromSuperview];} [Self removeFromSuperview];}-(void) Updated :( NSString *) animationID finished :( NSNumber *) finished context :( void *) context {[[UIApplication sharedApplication] setStatusBarHidden: NO withAnimation: UIStatusBarAnimationNone]; if ([animationID isEqualToString: @ "split"] & finished) {[self. left removeFromSuperview]; [self. right removeFromSuperview];} [self removeFromSuperview];} Description: splitIma Gew.twoparts (Terry Lin implementation) implements the classification of the UIImage and splits the image into two parts.

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.