zoukankan      html  css  js  c++  java
  • 引导页实现代码--iOS

    @interface PJXPushGuideView : UIView

    +(instancetype)guideView;

    +(void)show;

    @end

    #import "PJXPushGuideView.h"

    @implementation PJXPushGuideView

    +(instancetype)guideView{

        //加载xib

        PJXPushGuideView *guideView = [[[NSBundle mainBundle]loadNibNamed:NSStringFromClass(self) owner:nil options:nil] lastObject];

        guideView.backgroundColor = [UIColor colorWithRed:49.0/255.0 green:49.0/255.0  blue:49.0/255.0  alpha:0.75];

        return guideView;

    }

    - (IBAction)remove:(id)sender {

        [self removeFromSuperview];

    }

    +(void)show

    {

        NSDictionary *info = [[NSBundle mainBundle]infoDictionary];

        NSString *key = @"CFBundleShortVersionString";

        NSString * currentVersion = [info objectForKey:key];

        NSString *sanboxVersion = [[NSUserDefaults standardUserDefaults] stringForKey:key];

        if (![currentVersion isEqualToString:sanboxVersion]) {

            PJXPushGuideView *pushView = [PJXPushGuideView guideView];

            pushView.frame = [UIApplication sharedApplication].keyWindow.bounds;

            [[UIApplication sharedApplication].keyWindow addSubview:pushView];

            [[NSUserDefaults standardUserDefaults] setObject:currentVersion forKey:key];

            [[NSUserDefaults standardUserDefaults] synchronize];

            

        }

    }

    @end

     然后在PJXPushGuideView.xib中实现控件布局

  • 相关阅读:
    Mysql实战面试题
    初探Google Guava
    Spring IOC核心源码学习
    用3句话像老太太讲清楚什么是数据库
    matlab如何读入mat型的矩阵
    工作记忆数据处理
    功能连接
    奖励学习
    格兰杰因果关系及其在医学影像数据中的应用
    GC wm
  • 原文地址:https://www.cnblogs.com/PJXWang/p/5854743.html
Copyright © 2011-2022 走看看