Comments (2)
The code looks OK, although this line is redundant since it's the default anyway:
[AsyncImageLoader sharedLoader].cache = [AsyncImageLoader defaultCache];
Can you post more of the code? - where is this code used exactly? In a table view?
from asyncimageview.
I have used asyncImageView for paging : code is as follows
-(void) showPapers{
NSString *urlString = self.url;
NSArray *imageLinks = [[NSArray alloc] init];
imageLinks = [Utils htmlParsing: urlString];
for (int i = 0; i < imageLinks.count; i++) {
CGRect frame = [self.view frame];
frame.origin.x = self.scrollView.frame.size.width * i;
frame.origin.y = 0;
frame.size = self.scrollView.frame.size;
self.zoomView = [[ZoomScrollView alloc] initWithFrame:frame];
self.zoomView.frame = frame;
self.zoomView.navigationController = self.navigationController;
self.zoomView.imageUrl = [imageLinks objectAtIndex: i];
[self.zoomView initImageView];
[self.scrollView addSubview: self.zoomView];
}
self.scrollView.contentSize = CGSizeMake(self.scrollView.frame.size.width * imageLinks.count, self.scrollView.frame.size.height);
}
2.Code for ZoomScrollView is as follows:
-
(void)initImageView
{//self.imageUrl = [[NSString alloc] init];
self.tag = IMAGE_VIEW_TAG;
self.asyncImageView = [[AsyncImageView alloc]init];
self.asyncImageView.frame = CGRectMake(0, 0, self.bounds.size.width, self.bounds.size.height);
self.asyncImageView.contentMode = UIViewContentModeScaleAspectFit;
self.asyncImageView.imageURL = [NSURL URLWithString: self.imageUrl];
self.asyncImageView.userInteractionEnabled = YES;
[AsyncImageLoader sharedLoader].cache = [AsyncImageLoader defaultCache];//get image view
AsyncImageView *aImgeView = (AsyncImageView *)[self viewWithTag:IMAGE_VIEW_TAG];//cancel loading previous image for cell
[[AsyncImageLoader sharedLoader] cancelLoadingImagesForTarget : aImgeView];[self addSubview : self.asyncImageView];
// Add gesture,double tap zoom imageView.
UITapGestureRecognizer *doubleTapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self
action:@selector(handleDoubleTap:)];
[doubleTapGesture setNumberOfTapsRequired:2];
[self.asyncImageView addGestureRecognizer:doubleTapGesture];float minimumScale = self.frame.size.width / self.asyncImageView.frame.size.width;
[self setMinimumZoomScale:minimumScale];
[self setMaximumZoomScale:3.5];
[self setZoomScale:2.5];
}
App crashes when I view 5-6 images. Please help me finding a solution.
Thank you
from asyncimageview.
Related Issues (20)
- how to cancel all previous loading?
- Any swift version coming out soon? HOT 2
- Image loading problem with ImageIO error
- error: 'AsyncImageView' is ambiguous for type lookup in this context
- why not write to disk?
- AsyncImageLoadDidFinish doesnt get call if the image is cached HOT 3
- Does it support GIF?
- Crash: AsyncImageView.m line 340 -[AsyncImageLoader updateQueue] HOT 1
- How to show default iamge if the image is not loaded from server due to any error ?? HOT 2
- Can activityIndicator and placeholder image be used at the same time?
- AsyncImageView is not loading images in iOS 9.0 xcode 7+ HOT 2
- Trying to load Cached image when no internet is there, but shows blank. Is image cached and shows in Internet online mode only.
- Fatal Exception: NSInvalidArgumentException -[UIImageView setImageFailed:]: unrecognized selector sent to instance 0x127f2e860 HOT 3
- AsyncImageView.m line 175 -[AsyncImageConnection processDataInBackground:]
- How we can cache it permanently , Currently cache is clearing when come from background.
- Add Carthage support HOT 1
- AsyncImageView - [processDataInBackground:] returning an image with longer data bytes than the original HOT 1
- if Image Url is not valid
- If image url have space
- Update to swift 4.2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from asyncimageview.