非死book开源的加载效果工具:Shimmer

jopen 9年前

Shimmer最初是非死book在Paper中用于开发显示加载效果的 工具,后来非死book基于BSD开源协议将其开源,并且托管到GitHub上,分享给全球的开发者,支持iOS 6及其以上系统。使用Shimmer开发者能够非常简单的向移动应用中的任何视图添加闪闪发光的字体效果,并且不会显得突兀。

非死book开源的加载效果工具:Shimmer

用法:

为了使用Shimmer,必须创建FBShimmeringView或者FBShimmeringLayer并且添加内容。开始shimmering时将shimmering的属性设置为“YES”。如下是一个标签闪烁的例子:

FBShimmeringView *shimmeringView = [[FBShimmeringView alloc] initWithFrame:self.view.bounds];        [self.view addSubview:shimmeringView];    UILabel *loadingLabel = [[UILabel alloc] initWithFrame:shimmeringView.bounds];        loadingLabel.textAlignment = NSTextAlignmentCenter;        loadingLabel.text = NSLocalizedString(@"Shimmer", nil);        shimmeringView.contentView = loadingLabel;     // Start shimmering.        shimmeringView.shimmering = YES;

 

 Shimmer在GitHub上的主页地址:https://github.com/非死book/Shimmer

 Shimmer的官方地址:https://code.非死book.com/projects/1443302199240755/shimmer/