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
1 answer

How to set specific row cell's image of tableView to dynamic image

As below gif showed, in the specific row of tableView, the playing song's image(Just Dance.mp3) is changed to dynamic image. My main question is how to achieve this effect in my App, to use a GIF image or other approach? Need advice here. What…
Zhou Haibo
  • 1,681
  • 1
  • 12
  • 32
2
votes
1 answer

sliders slow down and don't move smoothly

I'm doing an application "Photo Editor". I'm beginner in swift. I have a problem with my sliders. They don't work as I need. May be someone know, how I can resolve this problem? Sliders don't work correctly and I need help with it. I don't know, why…
2
votes
4 answers

unable to use imageview

I have a very simple monotouch applicaiton where I am trying to reference image in an uiimageview but I am not successful. Following is the listing of code and the error I keep getting. Please help. I don't know what am I doing wrong.I have double…
irvinedotnet
  • 175
  • 1
  • 1
  • 8
2
votes
1 answer

How to fill image with color?

I have a png image which i want to fill with color. I know about tint color, but it color only borders, i need to color inside the borders, like this desired result Here I showed what I want to achieve
nobody47
  • 41
  • 1
  • 3
2
votes
2 answers

How can I stop my custom UITableViewCell backgroundImage from being stretchable?

If I create a background image for my table cell in the init method of my UITableViewCell subclass, the image comes out exactly how I drew it, and tableView:heightForRowAtIndexPath: simply adds a gap around it. But if instead I create the background…
Ric Levy
  • 966
  • 1
  • 15
  • 33
2
votes
1 answer

How to make a UIImage Scrollable inside a UIScrollView?

I currently have a ScrollView and inside the ScrollView i have a UIImageView. I get different image sizes from my server and most images are larger than the bounds of my screen. I would like to scroll through the image if it is bigger than my…
Cedan Misquith
  • 1,134
  • 9
  • 20
2
votes
1 answer

How can I fix this: "this class is not key value coding-compliant for the key imageview"?

I'm near the end of translating my code from Objective-C to Swift and I started switching the view controller classes to Swift. I managed to fix most of the problems with the view controllers but I keep getting this error for one of my View…
James Castrejon
  • 567
  • 6
  • 16
2
votes
3 answers

Displaying previous image on uiimageview

I have an app (Swift 5) using a UIImageView and a gesture method to change pictures when touching the image. It works great! The below code cycles thru all 26 pictures and starts over when at the last image. I want to create a button to go back…
Derek N
  • 49
  • 7
2
votes
0 answers

How to make Image move in UIImageView

I have an UIImageView which covers all of my screen. The pictures that I'm displaying are bigger than it and the .contentmode is set to the.scaleAspectFill So the UImageView is just showing a cropped version of each picture. In front of them is a…
Amir Sk
  • 158
  • 9
2
votes
3 answers

How to make a small uiimage and manually set pixels on it?

For a drop shadow, i want to make a 1px x 2px UIImage and manually set the pixels to certain RGBA values. How can i do this? I'd rather not pollute my bundle with tiny png's. Thanks!
Chris
  • 39,719
  • 45
  • 189
  • 235
2
votes
4 answers

error while setting image in imageView in iphone

I have written a code for setting imageview ...as per the button clicked...but my problem is when i press the button it is giving me the error like...too many arguments to function ImageNamed...while executing this line... UIImage* photo =…
Jean-Luc Godard
  • 1,873
  • 3
  • 28
  • 53
2
votes
1 answer

How to load image asynchronously with Swift using UIImageViewExtension and preventing duplicate images or wrong Images loaded to cells

Im developing an image loading library in Swift 4 something like Kingfisher with some extensions to support loading images from URL into an UIImageView . So then i can use this extension on a UICollection or UITableview cell with an UIImageView…
BigFire
  • 317
  • 1
  • 4
  • 17
2
votes
3 answers

not able to change image in an UIImageView

I have an image view and I am trying to change image of imageview everytime the orientation changes but the image is not changing can anybody help me on this - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation…
Ankit Sachan
  • 7,690
  • 16
  • 63
  • 98
2
votes
2 answers

Zooming an UIImageView that contains subviews

I have an UIImageView object in UIScrollView(to zoom). In addition, UIImageView also contains subviews. I am using following function to zoom in UIImageView. func viewForZooming(in scrollView: UIScrollView) -> UIView? { return…
Mahmut Acar
  • 713
  • 2
  • 7
  • 26
2
votes
2 answers

ImageView in splashScreen is showed blurred

I'm implementing a splash screen for my app, and when it runs, the splash contains a blurred image , not how it should be.
Esteban Chornet
  • 928
  • 3
  • 14
  • 38
1 2 3
99
100