Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
fanlilinSaber opened this issue Oct 30, 2024 · 0 comments
Open

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

fanlilinSaber opened this issue Oct 30, 2024 · 0 comments

Comments

@fanlilinSaber
Copy link

你好~在原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元素,我只需要这个缺省页帮我遮住就行了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant