uiimageview

iOS rounded corner UIImage with border

Deadly 提交于 2019-12-10 14:49:42
问题 Is there a way to make my image appear like this (rounded corners and with a light border). I'm thinking of creating a white mask that has the middle transparent to place on top, would that work? 回答1: You can accomplish this, but instead of editing your UIImage, just do this in your UIImageView. First, add the QuartzCore header #import <QuartzCore/QuartzCore.h> And then, edit the properties below, as you wish. imageView.layer.cornerRadius = 5.0; imageView.layer.borderColor = [[UIColor

Handling download of very large images with SDWebImage

柔情痞子 提交于 2019-12-10 13:45:29
问题 I use SDWebImage to download images asynchronously to my UIImageView s. Most images that received are of acceptable sizes, and can be easily downloaded, and set to the UIImageView s. However there are times, when the source image at the URL is of insanely high resolution (relative to the size of my imageView - 60x60). In such cases, the image is never set. Sometimes my app crashes, sometimes, nothing happens (image stays nil ), and in a very rare case I received an error something like :

UIImagePickerController: didFinishPickingMediaWithInfo not being called

 ̄綄美尐妖づ 提交于 2019-12-10 13:36:51
问题 Hope you're all doing well. Wondered if anyone could help me understand why Xcode fails to play nice with me.... I have broken the code into sections below in order to allow me to select a profile photo from UIImagePicker: WORKS: Assigning the delegate class for both ImagePicker & NavigationController WORKS: Instantiating the UIImagePicker variable WORKS: Load ImagePickerViewController and enable to select an image FAILS: Added additional functions for closing and finishing picking with a

How can I rotate an UIImageView in Interface Builder?

本小妞迷上赌 提交于 2019-12-10 13:25:38
问题 Is it possible to rotate an UIImageView in Interface Builder from XCode? Like I can do it in Photoshop, where I can scale and rotate an image. I know it is possible by code but is there a way to do this in the interface builder? 回答1: You can't do this in the current version of Xcode. You may submit a feature request to Apple at http://radar.apple.com However if you want to do it, you will need to write some code #define RADIANS(degrees) ((degrees * M_PI) / 180.0) theView.transform =

iOS - Get framing of Visible part of UIImage from UIImageView

跟風遠走 提交于 2019-12-10 13:13:52
问题 I am trying to make a transition like APP Tinder. Detail: In Screen One there is a Vertical Rectangular UIImaveView with contentMode = Aspect Fill, so it hides some portion of Image to adujust Aspect Ratio. In Screen Two (Detail Screen) the same image after transition has to to be passed, but the ImageView in Second screen is Square One. I want to make a Morphing kind of Transition in which User should think that the same ImageView from Screen One become square one in Second one without

UIImageView image stretched even though contentMode = UIViewContentModeScaleAspectFit

大憨熊 提交于 2019-12-10 12:33:32
问题 I am really disappointed by the way UIImageView displays the image. I have following piece of code: UIImageView *imgview = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 300, 100)]; imgview.image = [UIImage imageNamed:@"img.JPG"]; imgview.backgroundColor = [UIColor greenColor]; imgview.contentMode = UIViewContentModeScaleAspectFit; [self.view addSubview:imgview]; What I get is a following screenshot: http://img26.imageshack.us/img26/3686/screenshot20130123at629.png [image is stretched to

Why does my UIImageView replace the second one?

假装没事ソ 提交于 2019-12-10 12:16:03
问题 I have two outlets for two different UIImageViews, when I select the first one it'll appear on the first Image View but when I select the second Image, it replaces the first Image View even though it's connected to the second ImageView. This is my code for the Select Image button. @IBOutlet weak var myImageView1: UIImageView! @IBOutlet weak var myImageView2: UIImageView! @IBAction func pickImage1(_ sender: Any) { let image = UIImagePickerController() image.delegate = self image.sourceType =

how to pushViewController to another view with images in a scrollview

做~自己de王妃 提交于 2019-12-10 11:59:02
问题 I have a scrollview of images , I will like to tab them and will pushed to another view. once i tab on the image, the whole view should push to another view. From this View to another view Detail view Sorry for not asking the question clearly. my scrollview -(void)pictureScrolling { //init scrollview in location on screen scrollview = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 100, 320, 290)]; scrollview.backgroundColor = [UIColor redColor]; //pass image filenames NSMutableArray

Fill percent of UIImageView from full UIImage with animation

做~自己de王妃 提交于 2019-12-10 11:56:43
问题 I have an UIImageView named bigBottle : bigBottle.image = [UIImage imageNamed:@"fullBootle.png"]; fullBootle.png is a bottle filled up to 100%. I need two steps: First make a crop of image with percent (let`s say 50% fill ) - that is, a bottle filled up to half, from the bottom ). Animate bigBottle to creeate a filling effect from down of the bottle to 50% fill. My code is bellow: CGRect captureRect = CGRectMake(0,22,18,72); UIImage *captureImg; UIGraphicsBeginImageContext(captureRect.size);

How to draw line on the UIImageView not for UIView?

て烟熏妆下的殇ゞ 提交于 2019-12-10 11:55:58
问题 How to draw a line on the UIImageView? I am using the UIImageView Sub Class, Its not support drawRect: method. I want to draw a line on the image view. How can I do this? Please help me. I am using below code for draw line. - (void)drawRect:(CGRect)rect { CGContextRef c = UIGraphicsGetCurrentContext(); CGFloat red[4] = {1.0f, 0.0f, 0.0f, 1.0f}; CGContextSetStrokeColor(c, red); CGContextBeginPath(c); CGContextMoveToPoint(c, 5.0f, 5.0f); CGContextAddLineToPoint(c, 50.0f, 50.0f);