非死book開源的加載效果工具:Shimmer
Shimmer最初是非死book在Paper中用于開發顯示加載效果的 工具,后來非死book基于BSD開源協議將其開源,并且托管到GitHub上,分享給全球的開發者,支持iOS 6及其以上系統。使用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/
本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!