feat:fix Nested slider
This commit is contained in:
parent
b67ba993b4
commit
50c31c4a14
@ -156,6 +156,7 @@ @interface DoricFlowLayoutNode () <UICollectionViewDataSource, UICollectionViewD
|
|||||||
@property(nonatomic, assign) NSUInteger columnCount;
|
@property(nonatomic, assign) NSUInteger columnCount;
|
||||||
@property(nonatomic, assign) CGFloat columnSpace;
|
@property(nonatomic, assign) CGFloat columnSpace;
|
||||||
@property(nonatomic, assign) CGFloat rowSpace;
|
@property(nonatomic, assign) CGFloat rowSpace;
|
||||||
|
@property(nonatomic, copy) NSString *renderItemFuncId;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation DoricFlowLayoutNode
|
@implementation DoricFlowLayoutNode
|
||||||
@ -198,9 +199,14 @@ - (void)blendView:(UICollectionView *)view forPropName:(NSString *)name propValu
|
|||||||
self.itemCount = [prop unsignedIntegerValue];
|
self.itemCount = [prop unsignedIntegerValue];
|
||||||
[self.view reloadData];
|
[self.view reloadData];
|
||||||
} else if ([@"renderItem" isEqualToString:name]) {
|
} else if ([@"renderItem" isEqualToString:name]) {
|
||||||
[self.itemViewIds removeAllObjects];
|
if ([self.renderItemFuncId isEqualToString:prop]) {
|
||||||
[self clearSubModel];
|
} else {
|
||||||
[self.view reloadData];
|
[self.itemViewIds removeAllObjects];
|
||||||
|
[self clearSubModel];
|
||||||
|
[self.view reloadData];
|
||||||
|
self.renderItemFuncId = prop;
|
||||||
|
}
|
||||||
|
|
||||||
} else if ([@"batchCount" isEqualToString:name]) {
|
} else if ([@"batchCount" isEqualToString:name]) {
|
||||||
self.batchCount = [prop unsignedIntegerValue];
|
self.batchCount = [prop unsignedIntegerValue];
|
||||||
} else {
|
} else {
|
||||||
|
@ -54,7 +54,11 @@ @interface DoricScrollerNode ()
|
|||||||
|
|
||||||
@implementation DoricScrollerNode
|
@implementation DoricScrollerNode
|
||||||
- (DoricScrollView *)build {
|
- (DoricScrollView *)build {
|
||||||
return [DoricScrollView new];
|
return [[DoricScrollView new] also:^(DoricScrollView *it) {
|
||||||
|
if (@available(iOS 11, *)) {
|
||||||
|
it.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
|
||||||
|
}
|
||||||
|
}];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)initWithSuperNode:(DoricSuperNode *)superNode {
|
- (void)initWithSuperNode:(DoricSuperNode *)superNode {
|
||||||
|
@ -37,6 +37,7 @@ @interface DoricSliderNode () <UICollectionViewDataSource, UICollectionViewDeleg
|
|||||||
@property(nonatomic, assign) NSUInteger batchCount;
|
@property(nonatomic, assign) NSUInteger batchCount;
|
||||||
@property(nonatomic, copy) NSString *onPageSelectedFuncId;
|
@property(nonatomic, copy) NSString *onPageSelectedFuncId;
|
||||||
@property(nonatomic, assign) NSUInteger lastPosition;
|
@property(nonatomic, assign) NSUInteger lastPosition;
|
||||||
|
@property(nonatomic, copy) NSString *renderPageFuncId;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@interface DoricSliderView : UICollectionView
|
@interface DoricSliderView : UICollectionView
|
||||||
@ -92,9 +93,14 @@ - (void)blendView:(UICollectionView *)view forPropName:(NSString *)name propValu
|
|||||||
self.itemCount = [prop unsignedIntegerValue];
|
self.itemCount = [prop unsignedIntegerValue];
|
||||||
[self.view reloadData];
|
[self.view reloadData];
|
||||||
} else if ([@"renderPage" isEqualToString:name]) {
|
} else if ([@"renderPage" isEqualToString:name]) {
|
||||||
[self.itemViewIds removeAllObjects];
|
if ([self.renderPageFuncId isEqualToString:prop]) {
|
||||||
[self clearSubModel];
|
|
||||||
[self.view reloadData];
|
} else {
|
||||||
|
[self.itemViewIds removeAllObjects];
|
||||||
|
[self clearSubModel];
|
||||||
|
[self.view reloadData];
|
||||||
|
self.renderPageFuncId = prop;
|
||||||
|
}
|
||||||
} else if ([@"batchCount" isEqualToString:name]) {
|
} else if ([@"batchCount" isEqualToString:name]) {
|
||||||
self.batchCount = [prop unsignedIntegerValue];
|
self.batchCount = [prop unsignedIntegerValue];
|
||||||
} else if ([@"onPageSlided" isEqualToString:name]) {
|
} else if ([@"onPageSlided" isEqualToString:name]) {
|
||||||
|
Reference in New Issue
Block a user