We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
// 返回 Banner 在不同的 index 所要显示的 View (可以是完全自定义的v iew, 且无需设置 frame) - (UIView *)banner:(ZYBannerView *)banner viewForItemAtIndex:(NSInteger)index { // 取出数据 NSString *imageName = self.dataArray[index]; // 创建将要显示控件 UIImageView *imageView = [[UIImageView alloc] init]; imageView.image = [UIImage imageNamed:imageName]; imageView.contentMode = UIViewContentModeScaleAspectFill; return imageView; }
每次调用这个数据源方法就会产生一个临时的View(imageView),这样是不是有什么好的方法避免?
The text was updated successfully, but these errors were encountered:
这个数据源方法是banner滚动到当前index的时候才会调用, 不会导致创建大量的临时view. 不过的确是为了易用性没有考虑到重用. 下个版本会改成通过类似 dequeueReusableItemWithReuseIdentifier 的方式来获取重用的View.
dequeueReusableItemWithReuseIdentifier
Sorry, something went wrong.
@zzyspace 感谢,还有个问题就是如果一开始数据源为空的话,右滑不能滑,具体看demo,文件链接: http://www.wenjian.ml/Banner.zip
No branches or pull requests
每次调用这个数据源方法就会产生一个临时的View(imageView),这样是不是有什么好的方法避免?
The text was updated successfully, but these errors were encountered: