问题
I am currently using the Yelp API for my project, and I need to get the image of a business to use as a background, displayed in a UIImageView. However, all the pictures are too small from the pictures obtained, so the background is blurry. I use this code to obtain the current business images:
[UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:[businessDict objectForKey:@"image_url"]]]];
Is there anyway to obtain a larger image?
回答1:
Replace the filename at the end of the image URL with o.jpg
and you'll get up to 1000×1000 pixels. Other sizes are:
s.jpg
: up to 40×40ss.jpg
: 40×40 squarem.jpg
: up to 100×100ms.jpg
: 100×100 squarel.jpg
: up to 600×400ls.jpg
: 250×250 squareo.jpg
: up to 1000×1000348s.jpg
: 348×348 square
来源:https://stackoverflow.com/questions/17965691/yelp-api-ios-getting-a-larger-image