Update README.md
English Documents
骨架屏(Skeleton Screen)是一种优化用户弱网体验的方案。在弱网情况下,客户端获取到服务器数据的时间会比较长,通过骨架屏来减缓用户等待的焦躁情绪。 TABAnimated是提供给iOS开发者自动生成骨架屏的一种解决方案。开发者可以将已经开发好的视图,通过配置一些全局/局部的参数,自动生成与其结构一致的骨架屏。开发者用较少的开发成本,就可以获得和需求一致的骨架屏。
暗黑模式:
实时预览:
pod 'TABAnimated', '2.6.3'
github "tigerAndBull/TABAnimated"
在 didFinishLaunchingWithOptions 中设置全局参数
didFinishLaunchingWithOptions
[TABAnimated sharedAnimated].openLog = YES; [TABAnimated sharedAnimated].openAnimationTag = YES; ...
NewsCollectionViewCell就是业务方自己的cell,也可以绑定其他任意类型cell!
NewsCollectionViewCell
_collectionView.tabAnimated = [TABCollectionAnimated animatedWithCellClass:[NewsCollectionViewCell class] cellSize:[NewsCollectionViewCell cellSize]];
[self.collectionView tab_startAnimation];
[self.collectionView tab_endAnimation];
使用变量名修改
_tableView.tabAnimated.adjustBlock = ^(TABComponentManager * _Nonnull manager) { manager.animationN(@"titleImageView").down(3).radius(12); manager.animationN(@"nameLabel").height(12).width(110); manager.animationN(@"timeButton").down(-5).height(12); };
使用index修改
_tableView.tabAnimated.adjustBlock = ^(TABComponentManager * _Nonnull manager) { manager.animation(1).down(3).radius(12); manager.animation(2).height(12).width(110); manager.animation(3).down(-5).height(12); };
Swift
tableView.tabAnimated?.adjustBlock = { manager in manager.animation()?(1)?.down()(3)?.radius()(12) manager.animation()?(2)?.height()(12)?.width()(110) manager.animation()?(3)?.down()(-5)?.height()(12) }
manager.animation(x)
manager.animationN(@"x")
manager.animation(x)其实是视图addSubView尾递归排序。 在appDelegate设置TABAnimated的openAnimationTag属性为YES,框架就会自动为你指示,究竟x是几。
openAnimationTag
[TABAnimated sharedAnimated].openAnimationTag = YES;
animationN(@”x”)的x是变量名,不支持局部变量。
manager.animation(0).height(12).width(110);
manager.animation(1).placeholder(@"占位图名称.png");
manager.animations(1,3).width(50);
manager.animationWithIndexs(1,5,7).down(5);
在你集成列表视图之前,一定要理清列表视图结构。分为以下三种:
明确自身需求
最后到框架内找到对应的初始化方法、启动动画方法即可!
缓存策略和线程处理 架构设计和性能测试 预处理回调动画元素下标问题 问题答疑文档、版本信息记录文档 全局:局部属性、链式语法api 豆瓣动画详解 不再hook setDelegate和setDataSource 上拉加载更多
All source code is licensed under the License
©Copyright 2023 CCF 开源发展委员会 Powered by Trustie& IntelliDE 京ICP备13000930号
骨架屏
骨架屏(Skeleton Screen)是一种优化用户弱网体验的方案。在弱网情况下,客户端获取到服务器数据的时间会比较长,通过骨架屏来减缓用户等待的焦躁情绪。 TABAnimated是提供给iOS开发者自动生成骨架屏的一种解决方案。开发者可以将已经开发好的视图,通过配置一些全局/局部的参数,自动生成与其结构一致的骨架屏。开发者用较少的开发成本,就可以获得和需求一致的骨架屏。
优势
效果展示
暗黑模式:
实时预览:
Usages
流程图
一、导入
二、设置全局参数(可选)
在
didFinishLaunchingWithOptions
中设置全局参数三、初始化
NewsCollectionViewCell
就是业务方自己的cell,也可以绑定其他任意类型cell!四、控制骨架屏开关
五、预处理回调+链式语法用于修改骨架元素的属性
使用变量名修改
使用index修改
Swift
FAQ
1.
manager.animation(x)
和manager.animationN(@"x")
,x是几?manager.animation(x)其实是视图addSubView尾递归排序。 在appDelegate设置TABAnimated的
openAnimationTag
属性为YES,框架就会自动为你指示,究竟x是几。animationN(@”x”)的x是变量名,不支持局部变量。
2. 通过几个示例,了解预处理回调和链式语法
3. 列表集成问题
在你集成列表视图之前,一定要理清列表视图结构。分为以下三种:
明确自身需求
最后到框架内找到对应的初始化方法、启动动画方法即可!
4. 详细说明文档列表
Tips
Stargazers over time
License
All source code is licensed under the License