iOS 11 UITableView automatic height estimation fix (#485)

* Add iOS 11 checks.

* Negate iOS 11 automatic table height estimatation

* Negate iOS 11 automatic estimated table row heights

* Add note about iOS 11 estimated height behavior
This commit is contained in:
Christian Selig 2017-08-04 14:06:30 -03:00 committed by Huy Nguyen
parent 3c6b836571
commit 10efa31abd
3 changed files with 13 additions and 0 deletions

View File

@ -12,6 +12,7 @@
- Fix an issue in layout transition that causes it to unexpectedly use the old layout [Huy Nguyen](https://github.com/nguyenhuy) [#464](https://github.com/TextureGroup/Texture/pull/464)
- Add -[ASDisplayNode detailedLayoutDescription] property to aid debugging. [Adlai Holler](https://github.com/Adlai-Holler) [#476](https://github.com/TextureGroup/Texture/pull/476)
- Fix an issue that causes calculatedLayoutDidChange being called needlessly. [Huy Nguyen](https://github.com/nguyenhuy) [#490](https://github.com/TextureGroup/Texture/pull/490)
- Negate iOS 11 automatic estimated table row heights. [Christian Selig](https://github.com/christianselig) [#485](https://github.com/TextureGroup/Texture/pull/485)
##2.3.5
- Fix an issue where inserting/deleting sections could lead to inconsistent supplementary element behavior. [Adlai Holler](https://github.com/Adlai-Holler)

View File

@ -345,6 +345,13 @@ static NSString * const kCellReuseIdentifier = @"_ASTableViewCell";
_retainedLayer = self.layer;
}
// iOS 11 automatically uses estimated heights, so disable those (see PR #485)
if (AS_AT_LEAST_IOS11) {
super.estimatedRowHeight = 0.0;
super.estimatedSectionHeaderHeight = 0.0;
super.estimatedSectionFooterHeight = 0.0;
}
return self;
}

View File

@ -27,8 +27,13 @@
#define kCFCoreFoundationVersionNumber_iOS_10_0 1348.00
#endif
#ifndef kCFCoreFoundationVersionNumber_iOS_11_0
#define kCFCoreFoundationVersionNumber_iOS_11_0 1438.10
#endif
#define AS_AT_LEAST_IOS9 (kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber_iOS_9_0)
#define AS_AT_LEAST_IOS10 (kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber_iOS_10_0)
#define AS_AT_LEAST_IOS11 (kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber_iOS_11_0)
// If Yoga is available, make it available anywhere we use ASAvailability.
// This reduces Yoga-specific code in other files.