uiimageview

Prevent UIButton.imageView from resizing by image

跟風遠走 提交于 2020-01-17 02:31:27
问题 I have a UIButton with a fixed height of 40 (constraint height of 40) where I set an image via code thats an pdf (vectorgraphic) of size 64x64 . The result should be: I have added the image like the following: image = [UIImage imageNamed:@"icon-clear"]; [self setImage:image forState:UIControlStateNormal]; The result I'm getting is: Added a black border to the imageView for better visualisation. The imageView has a final size of 64x40 . The thing that happen, I guess, is that the imageView

How add a UIButton on every image of image view which is in scroll view?

偶尔善良 提交于 2020-01-16 18:14:21
问题 i have an iPhone app in which i have several images. These images add in image view. That image view add sub view with scroll view. Now i want to add a transparent button on every image. How can i do that? I have shown my code below: - (void)layoutScrollImages{ UIImageView *view = nil; NSArray *subviews = [scrollView1 subviews]; // reposition all image subviews in a horizontal serial fashion CGFloat curXLoc = 0; for (view in subviews) { if ([view isKindOfClass:[UIImageView class]] && view.tag

iOS: Autosizing an UIImage programmatically

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-16 17:35:55
问题 I have an UIImage in my app, and I had to uncheck the auto layout box and set autosizing with the options shown in the image below so the image will show properly in both screen sizes (3.5 inch, and 4 inch) My question is, how can I set these options in code? I tried this but it doesn't seem to work? Am I doing something wrong? file.m // Autosizing ImageOne ImageOne.autoresizingMask = UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleWidth |

How to give 3D effects to UIImageView/uiview using OpenGL looks like a 3D CUBE

别来无恙 提交于 2020-01-15 10:17:11
问题 I am new to OpenGL and don't much have knowledge in it. I want to add a 3D effect to a UIImageView . How can I achieve this using OpenGL? I want to do something like seen in this image: I have searched and found that it is possible using OpenGL. I have referred to this link With OpenGL . I have created a cube, and got some effect with glDrawElements(GL_TRIANGLES, sizeof(Indices)/sizeof(Indices[0]), GL_UNSIGNED_BYTE, 0); But I come to know with glDrawRangeElements we can make a 3d cube, But I

UIImageView with IBOutlet in Swift to see it in the Interface Builder

拥有回忆 提交于 2020-01-14 06:02:29
问题 When I insert an Image to my View like this it works: func loadSomeImage() { var imageView = UIImageView(frame: CGRectMake(100, 150, 150, 150)) var image = UIImage(named: "myImage.jpg") imageView.image = image self.view.addSubview(imageView) } My problem with this code is, that the ImageView is not shown in the Interface Builder. When I write this code however, I get an error: @IBOutlet weak var imageView: UIImageView func loadSomeImage() { self.imageView = UIImageView(frame: CGRectMake(100,

best simplest code to move a UIImage View from point A to point B

你。 提交于 2020-01-14 05:03:26
问题 @IBOutlet weak var imageView: UIImageView! override func viewWillAppear(animated: Bool) { self.imageView.center.y -= view.bounds.height } override func viewDidAppear(animated: Bool) { UIView.animateWithDuration(0.5, delay: 0.3, options: nil, animations: { self.imageView.center.y += self.view.bounds.height }, completion: nil) } This code does successfully move the image view across the screen, but I'm not sure how to make it stop where I want it to. It just slides off the screen. The goal is

How to make UITableView not change imageView's frame, or resize the image to fill the frame size?

巧了我就是萌 提交于 2020-01-13 16:25:12
问题 In tableView:cellForRowAtIndexPath , I am setting imageView.image to a 1x1, or 60x60 placeholder image, while the cell's height is 300. I also set imageView.frame to (0,0, 300, 300) . Then I call a method downloadImageFromURL:andSetIntoCell , which immediately add a UIActivityIndicatorView and set the frame to (0,0, 300, 300) (the download is done asynchronously in a thread, and the method won't wait for the download but just return immediately). However, after tableView:cellForRowAtIndexPath

How to make UITableView not change imageView's frame, or resize the image to fill the frame size?

佐手、 提交于 2020-01-13 16:23:30
问题 In tableView:cellForRowAtIndexPath , I am setting imageView.image to a 1x1, or 60x60 placeholder image, while the cell's height is 300. I also set imageView.frame to (0,0, 300, 300) . Then I call a method downloadImageFromURL:andSetIntoCell , which immediately add a UIActivityIndicatorView and set the frame to (0,0, 300, 300) (the download is done asynchronously in a thread, and the method won't wait for the download but just return immediately). However, after tableView:cellForRowAtIndexPath

How to implement Swipe Gesture for UIImageView randomizer

不羁的心 提交于 2020-01-13 14:13:12
问题 i've been looking through loads of tutorials and questions about this but can't seem to find what I'm looking for and I have a feeling I'm just missing a simple step.. I'm still learning the ropes so bear with me on this one.. I'm making an image randomizer on xcode 4.3.3 and i have been able to do it with a button to randomize the images, but i want it to respond to a swipe gesture. the whole window is covered by a UIImageView object so i just want an app that randomizes images by swiping so

how to display imageview tilted?

北城以北 提交于 2020-01-13 07:20:09
问题 i want to show my image view some arbitrary degrees tilted instead of just simple straight how to transform it to show tilted? Please help me. Edit this is the image view at present and i want like this only white bordered image view i want to tilt(slanted) not tiled 回答1: Just set the imageView s transform property: // 10 degrees imageView.transform = CGAffineTransformMakeRotation(M_PI / 180 * 10); 来源: https://stackoverflow.com/questions/10394376/how-to-display-imageview-tilted