feat:fix Nested slider

This commit is contained in:
pengfei.zhou 2019-12-07 10:59:20 +08:00
parent b67ba993b4
commit 50c31c4a14
3 changed files with 23 additions and 7 deletions

View File

@ -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]) {
if ([self.renderItemFuncId isEqualToString:prop]) {
} else {
[self.itemViewIds removeAllObjects]; [self.itemViewIds removeAllObjects];
[self clearSubModel]; [self clearSubModel];
[self.view reloadData]; [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 {

View File

@ -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 {

View File

@ -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]) {
if ([self.renderPageFuncId isEqualToString:prop]) {
} else {
[self.itemViewIds removeAllObjects]; [self.itemViewIds removeAllObjects];
[self clearSubModel]; [self clearSubModel];
[self.view reloadData]; [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]) {