uiimageview

Adjusting the line to fit our head in imageview

末鹿安然 提交于 2019-12-05 01:31:03
I am developing one application same as HairTryOn all things are done. but problem is display in following image. i want to set hair style as per customer face using blue line as per display in image. i used the following code testVw = [[UIView alloc]initWithFrame:CGRectMake(100,100, 100, 100)]; testVw.backgroundColor = [UIColor clearColor]; [self.view addSubview:testVw]; resizeVw = [[UIImageView alloc]initWithFrame:CGRectMake(testVw.frame.size.width-25, testVw.frame.size.height-25, 25, 25)]; resizeVw.backgroundColor = [UIColor clearColor]; resizeVw.userInteractionEnabled = YES; resizeVw.image

Retina/non-retina images in UIImageView

坚强是说给别人听的谎言 提交于 2019-12-05 01:28:13
I have a 300 x 300 sized UIImageView in my app which is displaying my images very nicely. My images are all 600 x 600 or larger and UIImageView simply resizes them for me. My question is this: as these images are essentially all retina images anyway (i.e. double the required pixel size) is there any point in making a retina and a non-retina version of the same image? Won't this just make my app bigger because of the extra image files? What's wrong with just letting the device downscale the images? I'm sure there's a very good answer so I'd like to know what it is! Thanks for your advice. For

How do I set the background of UIScrollView to be transparent?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-05 00:52:04
What i ultimately would LOVE to do is having my scroll view contents scrolling (in the scroll view control), and have a static background (a wallpaper image). I've tried a combination of things, none of which really yields what im looking for, not even close really. Has anybody attempted this before? This is actually very easy, a UIScrollView inherits from a UIView so you just need to set the backgroundColor property: aScrollView.backgroundColor = [UIColor clearColor]; The above line of code sets the background to transparent so you can see through to whatever you want to put behind. Note also

Spin bottle with UIGestureRecognizer

白昼怎懂夜的黑 提交于 2019-12-05 00:47:46
I am using this code now to spin bottle on button tap: @IBAction func spinButton(sender: AnyObject) { let rotateView = CABasicAnimation() let randonAngle = arc4random_uniform(360) + 720 rotateView.fromValue = 0 rotateView.toValue = Float(randonAngle) * Float(M_PI) / 180.0 rotateView.duration = 3 rotateView.delegate = self rotateView.repeatCount = 0 rotateView.removedOnCompletion = false rotateView.fillMode = kCAFillModeForwards rotateView.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseOut) bottleImageView.layer.addAnimation(rotateView, forKey: "transform.rotation.z") }

Images not all showing up on simulator but shows in storyboard

爷,独闯天下 提交于 2019-12-05 00:44:29
I am pretty new to iOS development and I was poking around in storyboard in Xcode 4.5.2. I started a new tab bar project (5 tabs) and then dropped in some images (UIImageViews objects) to them, everything looked good and the build came out fine on the simulator but not all the images are showing up. The same image would be showing on the Firstviewcontroller but it won't show on another viewcontroller. And I can't seem to add new image objects into the firstone (meaning i can place it in the storyboard but new ones won't show up on the simulator), It almost seems to be showing cached screens.

How to add interactive UILabels on top of a UIImageView?

天涯浪子 提交于 2019-12-04 23:24:13
问题 I need to add few labels on top of an UIImageView . The labels' text can be changed by tapping on them. What is the best way to achieve this? I am using Swift programming language. Looking up some solutions on stackoverflow, I found a couple of walkthroughs that use String.drawInRect method to draw some text in a rectangle which is then placed on the UIImageView . But like this I don't think I will be able to change the text, or even recognize a touch event on them. Please help. UPDATE My

Rotate UIImageView around its center point?

狂风中的少年 提交于 2019-12-04 23:13:43
问题 I have a transparent png inside a UIImageView ( self.myImage ) that I want to rotate around its center point. The code should be pretty simple: [self.myImage.layer setAnchorPoint:CGPointMake(0.5, 0.5)]; [UIView animateWithDuration:1.0 animations:^{ [self.myImage setTransform:CGAffineTransformMakeRotation(angle)]; }]; The image rotates at the right speed/time and at the right angle, but its position gets shifted. Here's an example of what's happening: The gray square is just to show position

Show image in ViewController when button is clicked in SecondViewController

自作多情 提交于 2019-12-04 22:04:56
How to show an UIIimage by clicking on an UIButton inside another UIViewController ? I would like to add to the same UIButton the command to add an image to the SecondViewController. Excused my poor question. myProtocol.h #import <Foundation/Foundation.h> @protocol myProtocol <NSObject> -(UIImage *)transferImage; @end ViewController.h #import "SecondClass.h" @interface ViewController : UIViewController<myProtocol, UINavigationControllerDelegate>{ UIView *view; } @property (nonatomic,retain) UIImageView *imageView; - (IBAction)sendImage:(id)sender; @end ViewController.m #import "ViewController

Get UIImageView using Afnetworking and put it in an array

◇◆丶佛笑我妖孽 提交于 2019-12-04 21:46:46
As the title says, i need to get the image and put it in an array. UIImageView *myImage = [[UIImageView alloc] init]; [myImage setImageWithURL:[NSURL URLWithString:@"http://host.com/images/1/1.png"] placeholderImage:[UIImage imageNamed:@"page3.png"]]; [items addObject:myImage]; the problem is that while the image is being loaded, the code continues and nothing gets put in the array, actually I guess an empty UIImageView gets inserted. How do I go about fixing this? On a side note I am using iCarousel to display images, in the data source it gets the images array and shows them. Can i modify

Remove programmatically added UIImageView

我与影子孤独终老i 提交于 2019-12-04 21:37:39
问题 I am creating a game that generates a playing card on a button click. I'm using this code to do this: var imageView = UIImageView(frame: CGRectMake(CGFloat(pos), 178, 117, 172)); var image = UIImage(named: "\(deck[Int(card)])_of_\(suits[Int(arc4random_uniform(4))])") imageView.image = image self.view.addSubview(imageView) But I have another button that resets the game. I want to be able to remove only the cards added programatically. Any help on this will be appreciated. 回答1: You can keep