|
9 | 9 | #import "CodingBannersView.h"
|
10 | 10 | #import "SMPageControl.h"
|
11 | 11 | #import "AutoSlideScrollView.h"
|
| 12 | +#import "YLImageView.h" |
12 | 13 |
|
13 | 14 | @interface CodingBannersView ()
|
14 | 15 | @property (assign, nonatomic) CGFloat padding_top, padding_bottom, image_width, ratio;
|
@@ -96,7 +97,7 @@ - (void)setCurBannerList:(NSArray *)curBannerList{
|
96 | 97 | };
|
97 | 98 | slideView.fetchContentViewAtIndex = ^UIView *(NSInteger pageIndex){
|
98 | 99 | if (weakSelf.curBannerList.count > pageIndex) {
|
99 |
| - UIImageView *imageView = [weakSelf p_reuseViewForIndex:pageIndex]; |
| 100 | + YLImageView *imageView = [weakSelf p_reuseViewForIndex:pageIndex]; |
100 | 101 | CodingBanner *curBanner = weakSelf.curBannerList[pageIndex];
|
101 | 102 | [imageView sd_setImageWithURL:[curBanner.image urlWithCodePath]];
|
102 | 103 | return imageView;
|
@@ -128,18 +129,18 @@ - (void)setCurBannerList:(NSArray *)curBannerList{
|
128 | 129 | NSLog(@"%@", _curBannerList);
|
129 | 130 | }
|
130 | 131 |
|
131 |
| -- (UIImageView *)p_reuseViewForIndex:(NSInteger)pageIndex{ |
| 132 | +- (YLImageView *)p_reuseViewForIndex:(NSInteger)pageIndex{ |
132 | 133 | if (!_imageViewList) {
|
133 | 134 | _imageViewList = [[NSMutableArray alloc] initWithCapacity:3];
|
134 | 135 | for (int i = 0; i < 3; i++) {
|
135 |
| - UIImageView *view = [[UIImageView alloc] initWithFrame:CGRectMake(kPaddingLeftWidth, _padding_top, _image_width, _image_width * _ratio)]; |
| 136 | + YLImageView *view = [[YLImageView alloc] initWithFrame:CGRectMake(kPaddingLeftWidth, _padding_top, _image_width, _image_width * _ratio)]; |
136 | 137 | view.backgroundColor = [UIColor colorWithHexString:@"0xe5e5e5"];
|
137 | 138 | view.clipsToBounds = YES;
|
138 | 139 | view.contentMode = UIViewContentModeScaleAspectFill;
|
139 | 140 | [_imageViewList addObject:view];
|
140 | 141 | }
|
141 | 142 | }
|
142 |
| - UIImageView *imageView; |
| 143 | + YLImageView *imageView; |
143 | 144 | NSInteger currentPageIndex = self.mySlideView.currentPageIndex;
|
144 | 145 | if (pageIndex == currentPageIndex) {
|
145 | 146 | imageView = _imageViewList[1];
|
|
0 commit comments