Skip to content

发现一个和OC版本的逻辑不一致问题 #57

Description

@fanlilinSaber

你好~在原OC版本中
453行代码中
if (([self isKindOfClass:[UITableView class]] || [self isKindOfClass:[UICollectionView class]]) && self.subviews.count > 1) {
[self insertSubview:view atIndex:0];
}
else {
[self addSubview:view];
}
这里是只有当UITableView和UICollectionView的时候才走 self.subviews.count 的逻辑
你的swift版本是
if (self is UITableView) || (self is UICollectionView) || (subviews.count > 1) {
insertSubview(view, at: 0)
} else {
addSubview(view)
}
你这里面全是用的 || 导致如果是UIScrollView 使用,强制显示会始终显示在最下层,本身我的UIScrollView可能会有一些基础view元素,我只需要这个缺省页帮我遮住就行了

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions