mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 06:35:51 +00:00
Force ASPagerNode pages to be bounds-sized (#2973)
This commit is contained in:
@@ -66,7 +66,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
* @param index The index of the node.
|
||||
* @return A constrained size range for layout the node at this index.
|
||||
*/
|
||||
- (ASSizeRange)pagerNode:(ASPagerNode *)pagerNode constrainedSizeForNodeAtIndex:(NSInteger)index;
|
||||
- (ASSizeRange)pagerNode:(ASPagerNode *)pagerNode constrainedSizeForNodeAtIndex:(NSInteger)index ASDISPLAYNODE_DEPRECATED_MSG("Pages in a pager node should be the exact size of the collection node (default behavior).");
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@@ -153,11 +153,14 @@
|
||||
|
||||
- (ASSizeRange)collectionNode:(ASCollectionNode *)collectionNode constrainedSizeForItemAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
if (_pagerDelegateFlags.constrainedSizeForNode) {
|
||||
return [_pagerDelegate pagerNode:self constrainedSizeForNodeAtIndex:indexPath.item];
|
||||
}
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
return ASSizeRangeMake(CGSizeZero, self.bounds.size);
|
||||
return ASSizeRangeMake(self.bounds.size);
|
||||
}
|
||||
|
||||
#pragma mark - Data Source Proxy
|
||||
|
||||
Reference in New Issue
Block a user