Comments (3)
This is UITableView's "bug like" problem in iOS8 (not in iOS7), -tableView:heightForRowAtIndexPath:
method will be called many times initially, and re-calculate when cell dequeues even you've scrolled through for more than one time, so this is why I provide a cacheByIndexPath
API to avoid a mess of height calculations.
When I implement cacheByIndexPath
, I found it's not easy to automatically invalidate caches when data source updates. So I used a tricky way, swizzled a private method who triggers reload ( -reloadData
, -insertSection..
,-deleteRows...
... all work) and clear all current caches, it's a bit more complex, but makes this cacheByIndexPath
API quite easy to use, no need for manual invalidation calls. But it has the "3 times" problem as you pointed, because UITableView itself triggers reload for 2 more times at init when it's being moved to window and layout its subviews. It's hard to solve unless I put the invalidateCaches
method public.
So I'm thinking a better solution.
from uitableview-fdtemplatelayoutcell.
Anything on this? I love the idea of this project and want to use it but without this iOS8 support, it kind of beats the purpose of it.
from uitableview-fdtemplatelayoutcell.
@sjapps Just use - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
api for height calculation, it's iOS6+ and pure. New version's coming and I'll close this issue by then.
from uitableview-fdtemplatelayoutcell.
Related Issues (20)
- 新手请教下关于xib使用 HOT 1
- 讨论下preferredMaxLayoutWidth HOT 2
- 优化高度计算fd_systemFittingHeightForConfiguratedCell HOT 1
- URL图片错乱问题
- 遇到一个问题,tableviewell做不定数量回复时出现bug
- - (CGFloat)fd_heightForHeaderFooterViewWithIdentifier:(NSString *)identifier configuration:(void (^)(id))configuration; HOT 2
- iphone6 plus 文字高度计算不精确
- 特别注意事项,该方法可解决你们超大难题 HOT 2
- 高度计算问题
- FD库能异步计算高度吗 HOT 1
- Archive HOT 1
- 针对RunLoop这块的处理,如果能封装到统一的工具类就好了,方便工程其他地方使用 HOT 3
- 使用autolayout, 加载本地数据, fd_systemFittingHeightForConfiguratedCell 方法中的contentViewWidth宽度 为0
- 使用缓存计算的方式页面上未显示的cell上的图片不就是提前加载了吗
- -fd_heightForHeaderFooterViewWithIdentifier: configuration: 方法没有执行回调,导致Header高度计算为0 HOT 2
- 😆大佬的框架好像没怎么维护了,我自己实现了一个类似的自动计算及缓存框架,逃~~,喜欢的小伙伴可以一起交流交流。 HOT 1
- 解决xibCell计算高度不准确问题
- 各位注意了deleteSections一次删除多个会导致缓存错乱
- Feature request - add a possibility to customize template cell creatation
- fd_systemFittingHeightForConfiguratedCell UITableView.contentInset != .zero,设置cell宽度有问题吧
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from uitableview-fdtemplatelayoutcell.