uiimageview

Swift, custom UITableViewCell with UIImageView. Need to resize cell to image height

自闭症网瘾萝莉.ら 提交于 2020-01-01 03:18:07
问题 I'am trying to make app, that will show images in table view. I have custom cell with image view. It only must download image data from url: @IBOutlet weak var tweetImage: UIImageView! var imageData : MediaItem? { didSet { updateUI() }} func updateUI(){ tweetImage.image = nil if let url = imageData?.url { if let data = NSData(contentsOfURL: url) { tweetImage.image = UIImage(data: data) } } } I need to get the cell height was changed after the download. It must be equal to the height of the

UIImageView scale from center using Animation Blocks

你。 提交于 2020-01-01 02:41:17
问题 I am using the following to scale image up but it's scaling from it's left top point, how can I make the scale from center [UIView animateWithDuration:duration delay:delay options:options animations:^{ myImageView.frame = frame; myImageView.alpha = alpha; } completion:^(BOOL finished) { } ]; 回答1: [UIView animateWithDuration:0.5 delay:0 options:UIViewAnimationOptionBeginFromCurrentState animations:(void (^)(void)) ^{ myImageView.transform=CGAffineTransformMakeScale(1.2, 1.2); } completion:^

How to I rotate UIImageView by 90 degrees inside a UIScrollView with correct image size and scrolling?

那年仲夏 提交于 2019-12-31 10:37:11
问题 I have an image inside an UIImageView which is within a UIScrollView. What I want to do is rotate this image 90 degrees so that it is in landscape by default, and set the initial zoom of the image so that the entire image fits into the scrollview and then allow it to be zoomed up to 100% and back down to minimum zoom again. This is what I have so far: self.imageView.transform = CGAffineTransformMakeRotation(-M_PI/2); float minimumScale = scrollView.frame.size.width / self.imageView.frame.size

How to I rotate UIImageView by 90 degrees inside a UIScrollView with correct image size and scrolling?

夙愿已清 提交于 2019-12-31 10:37:05
问题 I have an image inside an UIImageView which is within a UIScrollView. What I want to do is rotate this image 90 degrees so that it is in landscape by default, and set the initial zoom of the image so that the entire image fits into the scrollview and then allow it to be zoomed up to 100% and back down to minimum zoom again. This is what I have so far: self.imageView.transform = CGAffineTransformMakeRotation(-M_PI/2); float minimumScale = scrollView.frame.size.width / self.imageView.frame.size

Why does resource bundle copy .png as .tiff images?

纵饮孤独 提交于 2019-12-31 09:29:08
问题 I've created a static library and a resource bundle for reusing code and assets across several projects. Within the static library, I have a manager class whose sole purpose is to create other UIViewControllers , whose views are created from .xib files (using the common initWithNibName:bundle: method). When I create the view in Interface Builder, the images show correctly. However, when I run the app on the simulator, I get this error: Could not load the "<image_name.png>" image referenced

iPhone: UIImageView Fades in - Howto?

你。 提交于 2019-12-31 09:25:31
问题 I have an UIImageView that I want to fade in. Is there a way to enable that on an underlying UIViewController ? I have translated the simplest answer, though they all work, C# .NET for the MonoTouch users: public override void ViewDidAppear (bool animated) { base.ViewDidAppear (animated); UIView.BeginAnimations ("fade in"); UIView.SetAnimationDuration (1); imageView.Alpha = 1; UIView.CommitAnimations (); } 回答1: Initially set the alpha of your imageview as 0 as imageView.alpha = 0; - (void

iPhone: UIImageView Fades in - Howto?

点点圈 提交于 2019-12-31 09:24:09
问题 I have an UIImageView that I want to fade in. Is there a way to enable that on an underlying UIViewController ? I have translated the simplest answer, though they all work, C# .NET for the MonoTouch users: public override void ViewDidAppear (bool animated) { base.ViewDidAppear (animated); UIView.BeginAnimations ("fade in"); UIView.SetAnimationDuration (1); imageView.Alpha = 1; UIView.CommitAnimations (); } 回答1: Initially set the alpha of your imageview as 0 as imageView.alpha = 0; - (void

A simple way to put a UIImage in a UIButton

心不动则不痛 提交于 2019-12-31 09:04:12
问题 I have a UIButton in my iPhone app. I set its size to 100x100. I have an image that is 400x200 that I wish to display in the button. The button STILL needs to stay at 100x100... and I want the image to downsize to fit... but keep the correct aspect ratio. I thought that's what "Aspect Fit" was used for. Do I include my image with setImage, or setBackgroundImage? Do I set AspectFit for the button? or the image? or the background image? (I need the smaller images to INCREASE in size. While

Activity indicator with custom image

纵然是瞬间 提交于 2019-12-31 08:49:29
问题 I am loading a UIWebView and in the meantime I wan't to show a blank page with this activity indicator spinning (siri activity indicator). From what I have understand you can not change the image, but can't I use that image and create an animation with it rotating 360° and looping? Or will that drain the battery? something like this?: - (void)webViewDidStartLoad:(UIWebView *)webView { //set up animation [self.view addSubview:self.loadingImage]; //start animation } - (void)webViewDidFinishLoad

UIImageView does not show Image from UIImagePickerController

感情迁移 提交于 2019-12-31 06:25:59
问题 I am trying to take a picture with my app and then show it in a UIImageView that is predefined in my .xib. I have a IBOutlet UIImageView *_foto that is linked to the UIImageView in the .xib When I do the following the picture doesnt show in the UIImageView after taking a picture: - (void) imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)image editingInfo:(NSDictionary *)editingInfo { _foto.image = image; //Also tried set image, and resizing the image