Questions tagged [uiimageview]

An image view object provides a view-based container for displaying either a single image or for animating a series of images in iOS. For animating the images, the UIImageView class provides controls to set the duration and frequency of the animation. You can also start and stop the animation freely.

UIImageView is available in iOS 2.0 and later. New image view objects are configured to disregard user events by default. If you want to handle events in a custom subclass of UIImageView, you must explicitly change the value of the userInteractionEnabled property to YES after initializing the object. The question related can be tagged using .

When a UIImageView object displays one of its images, the actual behavior is based on the properties of the image and the view. If either of the image’s leftCapWidth or topCapHeight properties are non-zero, then the image is stretched according to the values in those properties. Otherwise, the image is scaled, sized to fit, or positioned in the image view according to the contentMode property of the view. It is recommended (but not required) that you use images that are all the same size. If the images are different sizes, each will be adjusted to fit separately based on that mode.

All images associated with a UIImageView object should use the same scale. If your application uses images with different scales, they may render incorrectly.

UIImage Class Reference

Resource:

Questions in Stack Overflow related to UIImageView:

Sample:

UIImageView *myImage = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 320, 460)];
//Allocating imageView and set its frame.

myImage.image = [UIImage imageNamed:@"myImage.png"];
//add image into imageview

[self.view addSubview:myImage];
// add imageview into your viewcontroller's view
10625 questions
2
votes
0 answers

"SDWebImage/UIImageView+WebCache.h file not found" error after changing project name

I had a Xcode project working fine. I changed the name of the project, closed Xcode and reopened the project. Now everything is cool except for a line in Bridging-Header.h There is a line which includes #import in…
2
votes
1 answer

Unrecognized selector sent to instance in UIButton

I have a collection view and image view inside it and I added a UIButton to delete the image after selection. When I click the button it crashes and gives me this error: AdPostViewController deleteUser]: unrecognized selector sent to instance…
Jacob
  • 121
  • 1
  • 8
2
votes
1 answer

alternative for uiimageview isanimating

i have a code which does some actions after UIImageView.isAnimating is false but funny part is it never goes false its always in YES state. " isAnimating return is faulty for UIImageView for iPhone " people from this link see the same fault with…
Yadnesh
  • 1,307
  • 3
  • 17
  • 36
2
votes
1 answer

How to Make UIImageView Framesize Larger Following Collision Detection

I have two UIImageViews named image1 and image2. What I want to do is: when image1 and image2 collide, image1 should grow larger( with a scale animation.) E.g. if image1 collides with image2 ten times , image1 should become 10 times bigger. I try…
bernard langue
  • 147
  • 1
  • 10
2
votes
1 answer

kCAFilterNearest maginifcation filter (UIImageView)

I am using QREncoder library found here: https://github.com/jverkoey/ObjQREncoder Basically, i looked at the example code by this author, and when he creates the QRCode it comes out perfectly with no pixelation. The image itself that the library…
sumderungHAY
  • 1,337
  • 18
  • 30
2
votes
1 answer

Any example iPhone code for an Analog Clock?

Interested in creating by own analog clock application - anyone know of some example project/code that implements an analogue clock? (i.e. not a digital clock). Ideally with a custom background, and custom hour/minute hands as images? I note that…
Greg
  • 34,042
  • 79
  • 253
  • 454
2
votes
1 answer

Adding a partial mask over an UIImageView

I want to add a 0.5 alpha mask over just one part of an image (that I will calculate in code). Basically, it's a 5-star rating control, but the stars are not one color, but some nice images like this: The image has a transparent background that I…
Crocodilu
  • 43
  • 5
2
votes
3 answers

Problem setting shadowColor property on UIImageView

NSString *imgPath = [[jsonObjects objectAtIndex:indexPath.row] valueForKey:@"image"]; NSData *imgData = [[NSData alloc] initWithContentsOfURL:[NSURL URLWithString:imgPath]]; UIImageView *img = [[UIImageView alloc] initWithFrame:CGRectMake(20, 7, 44,…
wstr
  • 910
  • 2
  • 13
  • 23
2
votes
1 answer

Swift: UIStackView height is always 0 despite adding elements

I have this stack view, it contains one ImageView: If I print its height, I always get 0: print("movieDetailsStackView!.bounds.height: ",movieDetailsStackView!.bounds.height ) // 0 print("movieDetailsStackView!.frame.height:…
AG_HIHI
  • 1,705
  • 5
  • 27
  • 69
2
votes
3 answers

iPhone UIImageView in UIScrollView not zooming to center

I have a UIImageView inside a UIScrollView so I can allow zooming, the zooming works but it doesn't keep the UIImageView centered and ends up cutting off the bottom of the image and leaves black space on top. This is what I have: -…
thechengster
  • 133
  • 1
  • 10
2
votes
2 answers

UITableView not showing background image

I have a uitableview with 2 cells (custom tableviewcells) and a button for login. I made them programmatically. Now I want to put a background image behind the 2 custom cells and the button. I went into IB and put the image view on top of the…
K.Honda
  • 3,106
  • 5
  • 26
  • 37
2
votes
2 answers

I want to exchange a particular color inside an image with another color. Is there any possible way?

I have one image with multiple colors. I want to change a specific color with the alternate color that i have pre-decided. Is there any algorithms to modify the image and save it? Help is appreciated. Thank you very much.
NIKHIL
  • 2,719
  • 1
  • 26
  • 50
2
votes
0 answers

Present UIImagePickerController from UIViewController that is already presented

I create a settings/editing type view controller like so: EditViewController *editController = [storyboard instantiateViewControllerWithIdentifier:@"parent"]; UINavigationController *navController = [[UINavigationController alloc]…
kanso
  • 750
  • 8
  • 17
2
votes
1 answer

iOS: Access UIImageView placed in Interface Builder from code

I've placed some images in my interface with Interface Builder and set them to be hidden on startup... Now I want to change the hidden attribute to FALSE, when I press a button, but I haven't tried accessing interface built images in my code before…
NoobiOS
  • 25
  • 1
  • 5
2
votes
3 answers

PDF vector image in Launch Screen, not scaling properly on device

I am using storyboard for my Launch Screen. I have an UIImageView and a UILabel in my Launch Screen. For the UIImageView's image, I am using a .pdf image that is located in Assets.xcassets. The default size of my image is 25x25 px but since it is a…
AW5
  • 406
  • 3
  • 12