初衷
最近项目新功能更改较大,产品童鞋要求加入新功能引导,于是一口气花了两天的时间做了一个引导页,当然加上后面的修修补补的时间,就不只两天了,不过这事情其实是一劳永逸的事情,值得做。同时为了能够更好的复用,我把它做成了pod库,项目地址在这里:eafeatureguideview。
eafeatureguideview能做什么
eafeatureguideview是uiview的一个扩展,用来做新功能引导提示,达到这样的效果:
最后的效果如下:
效果图1
效果图2
如何使用
如果安装了cocoapods,可以在podfile中加入如下代码:
pod 'eafeatureguideview',接着pod install一下。
接着在需要展示提示的页面引入头文件:
#import "uiview+eafeatureguideview.h"
最后添加如下代码:
eafeatureitem *item = [[eafeatureitem alloc] initwithfocusview:self.examplecell focuscornerradius:0 focusinsets:uiedgeinsetszero]; item.introduce = @"txt_feature_post_activity_4.1.png"; item.actiontitle = @"太好了"; item.action = ^(id sender){ nslog(@"touched .."); }; eafeatureitem *recents = [[eafeatureitem alloc] initwithfocusrect:cgrectmake(centerx - 25, centery - 25, 50, 50) focuscornerradius:25 focusinsets:uiedgeinsetszero]; recents.introduce = @"recents"; [self.navigationcontroller.view showwithfeatureitems:@[item, recents] savekeyname:@"keyname" inversion:nil];
可以优化的地方
介绍文案没有支持多颜色。
当高亮区域是圆形的时候,箭头的指向没有对中圆心。
原文链接:http://www.jianshu.com/p/c9a44edc9fbf
以上就是 ios 实现引导页的镂空效果的实例,有需要的参考下,谢谢大家对本站的支持!
如对本文有疑问, 点击进行留言回复!!
IOS系统中使用new Date()报错valid Date
解决Android10读取不到/sdcard/、/storage/emulated/0/文件的问题
Codeforces Round #649 (Div. 2)-B. Most socially-distanced subsequence(思维)
网友评论