问题
When calling [myTableView noteHeightOfRowsWithIndexesChanged: myIndexSet]
inside an NSAnimationContext
group, the height of the rows animates on 10.8, but does not animate on 10.9: it jumps instantaneously to the final height instead.
After some experimentation, I found that it does animate on 10.9 if you do not place that call to the table view in an NSAnimationContext
group.
This result is a bummer because I wanted to have other animations on the rows in sync with the height animation from the table view. Any ideas?
回答1:
You might try setAllowsImplicitAnimations: YES
For performance or legacy reasons some AppKit interface objects might not set that as a default. The tricky part is that bit about inheritance. Many things have important parts that are inherited but not always documented clearly in the immediate object docs. This is where some things are in AppKit release notes or only in WWDC videos.
来源:https://stackoverflow.com/questions/20924141/mavericks-issue-noteheightofrowswithindexeschanged-does-not-animate