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 make animation when changing UIImageView

I wrote this code and made 2 buttons, next and back, to display a picture in an NSMutubleArray using an UIImageView. -(IBAction) pictureNext:(id)sender; { if (pictureIndice==[promMUAraay count]) { pictureIndice=0; } …
user765110
  • 83
  • 1
  • 5
2
votes
0 answers

Adding UIImageView to ARSCNView scene background causes Saturation/Hue to be off

@IBOutlet var sceneView: ARSCNView! override func viewWillAppear(_ animated: Bool) { let imageView = UIImageView(frame: sceneView.bounds) imageView.contentMode = .scaleAspectFill imageView.image = UIImage(named: "myImage") …
Joe
  • 355
  • 1
  • 10
2
votes
2 answers

Blacking out areas of a UIImageView or showing part of the view

Is there a way to black out a region (defined by a frame) of a UIImageView without creating an overlaying UIView instance (with this frame) and blacking that out? Is there similarly a way to reveal part of a UIImageView without using UIView…
Ken
  • 30,811
  • 34
  • 116
  • 155
2
votes
1 answer

Making an area of a UIImage/UIScrollView "clickable"

So I have two issues to solve: Detect a click on an area in an UIImageView. Detect a click on an area in an UIScrollView. I'm thinking for both, since I have the x/y coordinates from the client, I'm going to programmatically instantiate an…
mr-sk
  • 13,174
  • 11
  • 66
  • 101
2
votes
1 answer

how to split an image in to multiple parts

how can I slice an image into multiple pieces ? my image size is 300x300 an I want to make 9 pieces of it. Thanks..
Maulik
  • 19,348
  • 14
  • 82
  • 137
2
votes
0 answers

Rotate 360 panoramic image with the device motion or with the gesture recognition Swift

I am trying to do use a 360 panoramic image, display it on the iPhone screen and go through it with phone motion. I was looking on the internet and I just found out that we can use the UIScrollView for a 180 panoramic image but I still can't find…
Elin
  • 105
  • 1
  • 7
2
votes
2 answers

UIImage inside table view cell

Inside my table view for each cell I have an image along with some text and other stuff. When I select a cell I want the image also to be covered with blue overlay. Right now all other stuff excluding image is getting selected and a blue overlay…
Abhinav
  • 37,684
  • 43
  • 191
  • 309
2
votes
1 answer

iOS: Programmatically align UIImageView to bottom using anchors

I am trying to create an UIImageView programmatically (so no storyboard/UI editor), and align it using anchor constraints. The UIImageView should be aligned to the bottom and be scaled to fit the bottom area (like a full-width footer), but maintain…
Henrik
  • 444
  • 4
  • 14
2
votes
0 answers

fetch binary data to a index array in swift

My swift code below is trying to fetch a numbered core data binary array. I am getting the error Cannot assign value of type 'UIImage' to type 'Data?' at piczy[I].This code works if I take the core data from a string but doing this with a image it…
user12655184
2
votes
1 answer

Autolayout images inside cells in tableview. Correct layout but only once scrolling down and back up?

Im trying to get tableview cells with auto resizing images to work. Basically I want the image width in the cell to always be the same, and the height to change in accordance with the aspect ratio of the image. I have created a cell class, which…
Thijs van der Heijden
  • 1,147
  • 1
  • 10
  • 25
2
votes
2 answers

iOS UIScrollView with UIImageView rotation aspect problem

I apologize in advance for my lack of iOS SDK knowledge, I am an Android developer that has been tasked with maintaining and updating an iPhone application. I am using a UIScrollView to handle zooming and dragging of an image that is being displayed…
snctln
  • 12,175
  • 6
  • 45
  • 42
2
votes
3 answers

image selected by imagePickerController (PhotoLibrary/Camera) not being displayed

I have a UIImageView outlet in my page. I want that to be filled with an image of user's choice. So on click of a button underneath, user can select image from library/camera. Till here all s fine. However, once the user selects an image, say from…
Andy
  • 1,080
  • 5
  • 20
  • 35
2
votes
0 answers

UIImage custom Init tint color

Description: I am writing an extension for UIImage which should initialize a system image with a given custom type of SystemImage. Everything works well except that the image tint color is not as I have configured in Storyboard for the UIImageView…
shbedev
  • 1,875
  • 17
  • 28
2
votes
0 answers

How to create full width image splash screen for react native ios app in xcode

My application require a splash screen with a round logo in the middle , the background has some design overlays, So I need the splash screen as a full screen image. I have referred to several post but could not find out how to create the splash…
Team Techi
  • 305
  • 3
  • 15
2
votes
2 answers

Can I resize just the image of an imageView?

So I have this code: override func viewDidLoad() { super.viewDidLoad() let imageView = UIImageView() view.addSubview(imageView) imageView.translatesAutoresizingMaskIntoConstraints = false …
NicolasElPapu
  • 1,612
  • 2
  • 11
  • 26
1 2 3
99
100