uiimageview

UIImageView as a link to a URL

微笑、不失礼 提交于 2019-12-10 10:35:53
问题 How to make a UIImageView open a URL in Safari when user clicks it? 回答1: I would suggest using a button for this purpose instead. You can create a custom UIButton with whatever image you want. This gives the advantage of providing the built-in target-action mechanism of a button, as well as being able to provided a highlighted image to provide the user feedback. Consider using something like this: UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; [button setImage:[UIImage

UIImageView does not zoom

前提是你 提交于 2019-12-10 10:20:20
问题 I would like to zoom an image on a popup view. I've created the UIView subclass, based on this sample code: ZoomView.h: @interface ZoomView : UIView <UIScrollViewDelegate> { UIScrollView *imageScrollView; UIImageView *imageView; } @property (strong, nonatomic) IBOutlet UIScrollView *imageScrollView; @property (strong, nonatomic) IBOutlet UIImageView *imageView; @end ZoomView.m: #import "ZoomView.h" #define ZOOM_VIEW_TAG 100 #define ZOOM_STEP 1.5 @interface ZoomView (UtilityMethods) - (CGRect

UIScrollview bounce and zoom with fixed top

时光毁灭记忆、已成空白 提交于 2019-12-10 09:52:58
问题 Trying to make UIImageView scale when the scrollview is bouncing down. The idea was stolen from this dribbble: https://dribbble.com/shots/3341878-Product-Page As you can see, image is like'a scaling when the scrollview is bouncing down. In my app I have the UIImageView inside the UIScrollview, I can't understand how to fix the top of the UIImageView while the UIScrolvview is bouncing down. Here is what I want to do: 回答1: Apply a scale transform to your imageView based on your scrollview's

create UIImageView

痴心易碎 提交于 2019-12-10 04:10:04
问题 How do I create a UIImageView in code, instead of creating it in my xib file? 回答1: UIImageView *someImageView = [[UIImageView alloc] initWithFrame:someRect]; someImageView.image = someImage; [self.view addSubview:someImageView]; Easy as pie! :D You might wanna check the apple docs too: http://developer.apple.com/library/ios/#documentation/uikit/reference/UIImageView_Class/Reference/Reference.html 回答2: You can create seperately a UIImage, and create your UIImageView from your UIImage. UIImage

How to fetch image and pdf file from json and display in tableviewcell swift 3

梦想与她 提交于 2019-12-10 03:54:13
问题 Hello all as i am a Fresher so dont know how to fetch image and pdf file from API and how to display in tableviewcell so that user can see the image and pdf file as well download it from there.I tried some code for image but its not working and dont have a single idea for pdf.Please help. code for image : I have declared an array of images like below : var announimage : Array = [UIImage]() Below is the format of my JSON data. { "Download_Details": [ { "school_id": 1, "class_id": "Pre - KG ",

How do i scale an image correctly with fixed width and auto layout?

跟風遠走 提交于 2019-12-10 03:38:30
问题 i've a dynamic UIImage and a UIImageView with fixed width of 280.0px and i'm using auto layout. On the UIImage view I've set width and height constraints and lowered the priority of the height constraint. I've selected "aspect fit", and raised content hugging and compression priority to 1000. In that case the UIImageView is resized to maintain the ratio, but the height is bigger then i want. The aspect ratio is preserved because there are empty spaces on top and bottom of the UIImageView. I

[UIImageView _isResizable]: unrecognized selector sent to instance SIGABRT

烂漫一生 提交于 2019-12-10 03:32:40
问题 I've got this code trying to run a simple set of images in a cycle. All I have in the app is one UIImageView declared in my View Controller's .h file: @property (strong, nonatomic) IBOutlet UIImageView *imageDisplay; And the following in my .m file's viewDidLoad method: NSMutableArray *imageView = [[NSMutableArray alloc] init]; [imageView addObject:[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"EyeAnim1.png"]]]; [imageView addObject:[[UIImageView alloc] initWithImage:[UIImage

UIViewController IBOutlets are nil

百般思念 提交于 2019-12-10 03:28:22
问题 I have an UIViewController class with two labels and a UIImageView set as IBOutlets, and I have this outlets connected in my xib, I have double checked they are connected properly, however when I check the their value in the debugger they are 0x0 so I cant change them programatically. Any ideas on what I might be doing wrong. Heres the header file of my code: #import <UIKit/UIKit.h> @interface PlateDetailViewController : UIViewController { IBOutlet UIImageView *image; IBOutlet UILabel *price;

AFNetworking 3.0 setImageWithURLRequest download progress

ⅰ亾dé卋堺 提交于 2019-12-10 02:50:15
问题 Does anyone have a nice working solution for getting the download progress when using the UIImageView+AFNetworking category and AFNetworking 3.0. This category, which I did use for versions up till 3.0 has stopped working now. Here is my own experimental version which sadly, for the moment, crashes randomly. 回答1: Here is the modified version of AFNetworking 3.0 in which you can show a progress while loading image from server using UIImageView+AFNetworking category. https://github.com

Retina/non-retina images in UIImageView

一笑奈何 提交于 2019-12-10 02:07:58
问题 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