zoukankan      html  css  js  c++  java
  • iOS 添加功能引导图

    iOS 添加功能引导图

     
    首次安装app之后,打开app首页,有一张功能引导图,其实最简单的一种做法是,直接在这个首页上加一个蒙层图片。
    
    在蒙层上用气泡显示文字注明功能介绍,这个蒙层图片,让你们的UI设计师给你。

    然后在进入首页的viewDidAppear方法里,添加上你的蒙层

    [self initIntroduceView];

    下面是添加的简单示例代码:

    示例

    - (void)initIntroduceView
    
    {
    
    if (![USERDEFAULT objectForKey:@"IsShowIntro"]) {
    
    UIImageView *introImg = [[UIImageView alloc] initWithFrame:self.view.bounds];
    
    introImg.tag = INTRO_TAG;
    
    introImg.userInteractionEnabled = YES;
    
    if (iPhone4S) {
    
    introImg.image = [UIImage imageNamed:@"explanation_960"];
    
    }
    
    else
    
    {
    
    introImg.image = [UIImage imageNamed:@"explanation"];
    
    }
    
    [self.tabBarController.view addSubview:introImg];
    
    UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(removeIntroImg)];
    
    tap.numberOfTapsRequired = 1;
    
    [introImg addGestureRecognizer:tap];
    
    }
    
    }
    
    - (void)removeIntroImg
    
    {
    
    [USERDEFAULT setObject:[NSNumber numberWithBool:YES] forKey:@"IsShowIntro"];
    
    UIImageView *imgView = (UIImageView *)[self.tabBarController.view viewWithTag:INTRO_TAG];
    
    [imgView removeFromSuperview];
    
    }
    
    关于几个宏
    
    #define USERDEFAULT [NSUserDefaults standardUserDefaults]
    
    #define iPhone4S ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 960), [[UIScreen mainScreen] currentMode].size) : NO)
    
    #define INTRO_TAG 50000
  • 相关阅读:
    学生数据增删改查--顺序表
    应用3+2mvc第一次作业
    双色球随机选【代码】
    字符串穷举
    使用nuget发布自己的包
    VS CODE中配置JAVA格式化细节
    反射的理解(含一点xml)
    UdpClient实现udp消息收发
    c#背包问题代码
    利用TcpClient,简单的tcp消息收发
  • 原文地址:https://www.cnblogs.com/LiLihongqiang/p/7423284.html
Copyright © 2011-2022 走看看