FlowLayoutItem add fullSpan attribute
This commit is contained in:
@@ -401,7 +401,8 @@ - (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collection
|
||||
DoricFlowLayoutItemNode *node = cell.viewNode;
|
||||
node.viewId = model[@"id"];
|
||||
[node blend:props];
|
||||
BOOL fillWidth = (self.hasHeader && position == 0)
|
||||
BOOL fillWidth = [props[@"fullSpan"] boolValue]
|
||||
|| (self.hasHeader && position == 0)
|
||||
|| (self.hasFooter
|
||||
&& position == self.itemCount
|
||||
+ (self.loadMore ? 1 : 0)
|
||||
@@ -456,7 +457,7 @@ - (NSInteger)doricFlowLayoutColumnCount {
|
||||
|
||||
- (BOOL)doricFlowLayoutItemFullSpan:(NSIndexPath *)indexPath {
|
||||
NSUInteger position = (NSUInteger) indexPath.row;
|
||||
return (self.hasHeader && position == 0)
|
||||
if ((self.hasHeader && position == 0)
|
||||
|| (self.hasFooter
|
||||
&& position == self.itemCount
|
||||
+ (self.loadMore ? 1 : 0)
|
||||
@@ -464,7 +465,12 @@ - (BOOL)doricFlowLayoutItemFullSpan:(NSIndexPath *)indexPath {
|
||||
+ (self.hasFooter ? 1 : 0)
|
||||
- 1)
|
||||
|| (self.loadMore
|
||||
&& position == self.itemCount + (self.hasHeader ? 1 : 0));
|
||||
&& position == self.itemCount + (self.hasHeader ? 1 : 0))) {
|
||||
return YES;
|
||||
} else {
|
||||
NSDictionary *model = [self itemModelAt:position];
|
||||
return [model[@"props"][@"fullSpan"] boolValue];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
|
||||
|
Reference in New Issue
Block a user