uiimageview

UIImageView animation not working correctly

时光怂恿深爱的人放手 提交于 2019-12-25 01:40:45
问题 I want to make the width of an UIImageView larger through an animation. I have an UIView with and UIImageView made in the story board. What I want to achieve is so that it looks like the view is scaling from left to right, and keeping its original position. I have tried the following code, but what it does is animating the imageview from the top left corner of its parent view and moving and scaling it until it reaches the position and scale it had from the beginning. [UIView

Want to display image in the circle it is possible and how

陌路散爱 提交于 2019-12-25 01:03:28
问题 hi i want to display image in the circle not in the rectangle and all this will display in the tableview 回答1: You have to #import <QuartzCore/QuartzCore.h> and add a cornerRadius to your imageView [yourImageView.layer setCornerRadius:yourImageView.frame.size.width/2] maybe you have to add [yourImageView setClipsToBounds:YES] , but i am not sure about this. 回答2: One way of doing this is to create a subclass of NSView. Then in you override drawrect: methods to do your custom drawing. You start

Changing the position of UIImageViews based on the size of the device

狂风中的少年 提交于 2019-12-25 00:13:10
问题 I have a grid of UIImageView s. The layout looks fine on the 5S but the on the 6 or 6+ the grid is in the upper left corner. I decided to try to test for the screen size, which is explained in this question (The test works); then based on the screen size, re-position the UIImageView s using CGRectMake as suggested in this post. Here is the code: if UIDevice().userInterfaceIdiom == .Phone { switch UIScreen.mainScreen().nativeBounds.height { case 480: println("iPhone Classic") case 960: println

Button click not working when in presence of single Tap gesture

假装没事ソ 提交于 2019-12-24 21:09:05
问题 I have view hierarchy as follows MyViewController --> ScrollView(added via IB) --> ImageView (+ zooming there) ---> button added on image View (added via code) imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"map.png"]]; [scroll addSubview:imageView]; UIButton *myButton = [UIButton buttonWithType:UIButtonTypeRoundedRect]; myButton.frame = CGRectMake(660, 120, 40, 40); [myButton setTitle:@"10" forState:UIControlStateNormal]; [myButton addTarget:self action:@selector

How to check if have a new version of the image is available, before download?

只愿长相守 提交于 2019-12-24 20:28:32
问题 I have some images that is stored in my WebServer. So I want that always that the user opens the app or refresh, it check if have a new version of the image available and if yes, download it? I have tried https://github.com/Julioacarrettoni/iOS-ImageManager, but it doesn't work, it keeps reloading the view all the time. Thanks, 回答1: There are a couple of ways for the app to know if the image has been updated on the server: Guess that it might change once a week and not worry about the

UIImageview not getting rounded

女生的网名这么多〃 提交于 2019-12-24 19:08:24
问题 I am trying to create a circular image and I have implemeted the right code but I do not know why it does not get rounded below is my code lazy var profileImage: UIImageView = { let image = UIImageView() image.translatesAutoresizingMaskIntoConstraints = false image.layer.borderColor = UIColor.blue.cgColor image.layer.borderWidth = 1.5 image.image = UIImage(named: "prof.jpg") image.contentMode = .scaleAspectFit image.layer.cornerRadius = image.frame.size.width / 2 image.clipsToBounds = true

Displaying images in table using HTTP 'POST' request

六眼飞鱼酱① 提交于 2019-12-24 18:12:39
问题 I am wondering how I can display the images into a table uploaded by a certain device like an "Upload History" option. I have the request retrieving the images as such... NSString *post = [NSString stringWithFormat:@"device_code=%@", deviceCode]; NSData *postData = [post dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES]; NSString *postLength = [NSString stringWithFormat:@"%d",[postData length]]; NSMutableURLRequest *request = [[NSMutableURLRequest alloc] init]; [request setURL

UIImage how to resize bubble image with capInsets?

ぐ巨炮叔叔 提交于 2019-12-24 16:39:51
问题 I have bubble like image, that I need to resize dynamically. Example attached. I will have dynamic text and I need to resize only straight parts of bubble. Leave down arrow on the middle How can I do this? Thanks 回答1: You can use method: - (UIImage *)stretchableImageWithLeftCapWidth:(NSInteger)leftCapWidth topCapHeight:(NSInteger)topCapHeight; call like this: UIImage* image = [[UIImage imageNamed:@"bubbleImageName.png"] stretchableImageWithLeftCapWidth:15 topCapHeight:13]; Change capWidth and

How to remove a subview from memory and display right away?

回眸只為那壹抹淺笑 提交于 2019-12-24 14:52:37
问题 How do I remove a UIImageView's subview (a View Controller in this case) from memory and display immediately? [myGroovySubview release]; isn't doing it. Any help appreciated! Thanks // :) 回答1: myGroovySubview.hidden = YES; hides the view. You could also try to remove it from its superview with [myGroovySubview removeFromSuperview]; If you removed it from its superview, the release call should automatically remove it from memory since the reference count should be zero after that call. 来源:

how to do imageView.startAnimating() with completion in swift? [duplicate]

拈花ヽ惹草 提交于 2019-12-24 14:12:38
问题 This question already has answers here : Cocoa animationImages finish detection (3 answers) Closed 4 years ago . I would like a simple image array animation to run when a button is clicked. The below code works well, but I would like the last image in the array to be set as the imageview image after. How would I change the image on completion instead of it going back to the original? let imageArray = [UIImage(named: "Frog-1.gif")!, UIImage(named: "Frog-2.gif")!, UIImage(named: "Frog-3.gif")!,