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
2 answers

EXC_BAD_ACCESS error in Xcode

I really need you guy HELP , I run my program in Xcode and its successful but later, Its show me this error: **Thread 1: Program received signal :"EXC_BAD_ACCESS" on my program line that I have **bold below : - (NSString *) ocrImage: (UIImage *)…
user
  • 21
  • 1
2
votes
4 answers

iOS UIImageView Position

I need to put an image to the bottom of screen, so I used UIImageView and tried two ways to specify its position: someImageView.frame=CGRectMake(x, y, a, b); [someImageView initWithFrame:CGRectMake(x, y, a, b)]; But it shows up at the top covering…
City Techno
  • 151
  • 3
  • 13
2
votes
1 answer

Tiling an image in a UIVIew

I am trying to tile an image for an app I am making. I am making rope that I can set the length for. In order to do this, I have a function that takes my rope length, sets the frame size accordingly, and then sets the background color like…
WolfLink
  • 3,308
  • 2
  • 26
  • 44
2
votes
2 answers

UIImageView animationImages Cannot Be Changed?

I am animating images with UIImageView: imageView.animationImages = [NSArray arrayWithArray:imgNameArr]; imageView.animationDuration = 2; imageView.animationRepeatCount = 0; [imageView startAnimating]; At some point later I am…
Vad
  • 3,658
  • 8
  • 46
  • 81
2
votes
6 answers

Specify width of the cell imageView

Is it possible to constraint the width of [[cell imageView] a standard UITableViewCell? I've tried [[cell imageView] setFrame:CGRectMake(0, 0, 50, 50)] but it has no effect. [EDIT] Otherwise, is it possible to change a UIImage size before adding it…
Nielsou Hacken-Bergen
  • 2,606
  • 6
  • 27
  • 37
2
votes
1 answer

Can't combine UIImageView rotation animation and tableView section reload

I have 4 sections, each section have 2 nested rows. I open the rows by tapping on each section. Here is how my initial data looks like. It has title, subtitle and options (which is what nested rows should display): private var sections = [ …
artexhibit
  • 198
  • 3
  • 17
2
votes
1 answer

Dragging the imageview by means of touches

My App deals with an imageview and I want to drag the image all over the view by means of touches. -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { // This gets you starting position of UITouch *touch = [ [ event allTouches ]…
Icoder
  • 330
  • 3
  • 25
2
votes
2 answers

Removing UIImageView from UIScrollView

My app consists of an image gallery. It is a scroll view which displays pics retrieved from the sqlite db. User can scroll the images, add or delete images etc. I can add a picture to the gallery dynamically. But the problem comes when I need to…
stack2012
  • 2,146
  • 2
  • 16
  • 23
2
votes
1 answer

Identify a percentage of transparent pixels in an area of UIImageView

I'm trying to set up a collision type hit test for a defined of pixels within a UIImageView. I'm only wish to cycle through pixels in a defined area. Here's what I have so far: - (BOOL)cgHitTestForArea:(CGRect)area { BOOL hit = FALSE; …
markturnip
  • 405
  • 2
  • 7
2
votes
2 answers

How to scale UIImageView properly with UIView animateWithDuration?

I'm scaling UIImageView and then reverting it using UIView animateWithDuration with UIViewAnimationOptionAutoreverse option. The problem is the image animation is a little bit jaggy (twitching) at the end of the animation. Here's my code: [UIView…
Centurion
  • 14,106
  • 31
  • 105
  • 197
2
votes
2 answers

What is the best practice for letting users take photos and using them also in a table view?

When developing a mobile app, and letting the user take photos (That later will be shown in full size also) but are also viewed in the table views (mid size) and even in the Google maps pin title view, Should I create a thumbnail/s for every image…
Erez
  • 1,933
  • 5
  • 29
  • 56
2
votes
1 answer

UIImage with the corner round itself

Due to the auto layout feature, I tried to use UIImage corner radius instead of UIImageView. The corner radius was too thin when the photo was too large, such as 4k x 4k, but when the photo was small, such as 500 x 500, the corner radius was too…
Travgalax
  • 81
  • 1
  • 7
2
votes
2 answers

passing thumb image to other uiview on selecting particular row in UITable+iphone

I made a table where I used the customcell in the table. In the cell there are two buttons. Detail Available. When a user clicks the detail button I want the thumb image to appear in the Imageview of the selected row(cell) to the other view. When…
ios developer
  • 3,363
  • 3
  • 51
  • 111
2
votes
2 answers

modify the width of an imageView with animation

I have an image "image1" which is a UIButton and what I want is that if I touch this button, the width of the image is multiplied by two (with animation)not the height just the width. sorry for my english I'm french :/
bernard langue
  • 147
  • 1
  • 10
2
votes
0 answers

Why does CGAffineTransform(Rotate) work differently for UIBezierCurve and UIImageView?

I’m using a drawingView which is simply a VC’s view to draw a rectangle that rotates depending on a pan gesture. I apply 3 transforms on it. I translate the rectangle half it’s width left to put the top center of the rectangle at 0,0; rotate it some…
Dru Freeman
  • 1,766
  • 3
  • 19
  • 41