聚光灯

作者: 魔力双鱼 | 来源:发表于2020-04-22 14:07 被阅读0次

    1.WSCoachMarksView2013年的第三方库,比较古老

    1.文字、按钮在聚光灯上面(默认在聚光灯下面)

    NSArray *coachMarks = @[
    @{@"rect": [NSValue valueWithCGRect:(CGRect){{SCREEN_WIDTH/8.0*5-25,SCREEN_HEIGHT-HeightOfTabBar},{50,50.0f}}], @"caption": @"",@"bottomImage":@"我知道了",@"midleImage":@"文字提示-首页",@"positionCaption": @"1"},
    ];
    [self creatSpotlightView:FistHomeSpotlight withArray:coachMarks withSuprView:[UIApplication sharedApplication].keyWindow];
    

    2.在UIViewController中写分类

    //聚光灯
    - (void)creatSpotlightView:(NSString *)keyString withArray:(NSArray *)coachMarks withSuprView:(UIView *)suprView{
       if (![[NSUserDefaults standardUserDefaults] boolForKey:keyString]) {
           WSCoachMarksView *coachMarksView = [[WSCoachMarksView alloc] initWithFrame:(CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)) coachMarks:coachMarks];
           [suprView addSubview:coachMarksView];
           coachMarksView.delegate = self;
           [coachMarksView start];
           [[NSUserDefaults standardUserDefaults] setBool:YES forKey:keyString];
       }
    }
    

    3.效果如图所示

    Simulator Screen Shot - iPhone 11 Pro Max - 2020-04-22 at 13.58.11.png

    相关文章

      网友评论

          本文标题:聚光灯

          本文链接:https://www.haomeiwen.com/subject/pwwbihtx.html