Skip to content

Commit

Permalink
update: filter UITextView、UIScollViewIndicator
Browse files Browse the repository at this point in the history
  • Loading branch information
tigerAndBull committed Nov 2, 2021
1 parent 691a1e6 commit c5fe7dc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,6 @@ + (void)resetData:(UIView *)view {

+ (BOOL)canProduct:(UIView *)view tabAnimated:(TABViewAnimated *)tabAnimated {

if ([view isKindOfClass:[UITextField class]] && tabAnimated.needToCreateTextFieldLayer) {
return YES;
}

if ([view.superview isKindOfClass:[UITextField class]]) {
return NO;
}

if ([view isKindOfClass:[UICollectionView class]] || [view isKindOfClass:[UITableView class]]) {
// 判断view为tableview/collectionview时,若有设置骨架动画,则返回NO;否则返回YES,允许设置绘制骨架图
if (view.tabAnimated) {
Expand Down
15 changes: 14 additions & 1 deletion TABAnimatedDemo/TABAnimated/Product/TABAnimatedProductImpl.m
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,8 @@ - (void)_recurseProductLayerWithView:(UIView *)view
UIView *subV = subViews[i];
if (subV.tabAnimated) continue;

if ([self _withoutSubViewsWithView:view tabAnimated:_controlView.tabAnimated]) continue;

BOOL stopRes = NO;
if (subV.class == _controlView.tabAnimated.withoutSubViewsClass) {
stopRes = YES;
Expand Down Expand Up @@ -510,12 +512,23 @@ - (void)_buttonLayerSyncProperties:(UIButton *)button layer:(TABComponentLayer *

#pragma mark -

- (BOOL)_withoutSubViewsWithView:(UIView *)view tabAnimated:(TABViewAnimated *)tabAnimated {
if ([view isKindOfClass:[UITextField class]] && !tabAnimated.needToCreateTextFieldLayer) {
return YES;
}
if ([view isKindOfClass:[UITextView class]]) {
return YES;
}
return NO;
}

- (BOOL)_cannotBeCreated:(UIView *)view superView:(UIView *)superView rootView:(UIView *)rootView {

if ([view isKindOfClass:[NSClassFromString(@"UITableViewCellContentView") class]] ||
[view isKindOfClass:[NSClassFromString(@"UICollectionViewCellContentView") class]] ||
[view isKindOfClass:[NSClassFromString(@"_UISystemBackgroundView") class]] ||
[view isKindOfClass:[NSClassFromString(@"_UITableViewHeaderFooterViewBackground") class]]) {
[view isKindOfClass:[NSClassFromString(@"_UITableViewHeaderFooterViewBackground") class]] ||
[view isKindOfClass:[NSClassFromString(@"_UIScrollViewScrollIndicator") class]]) {
return YES;
}

Expand Down

0 comments on commit c5fe7dc

Please sign in to comment.