uiimageview

Apple Interface Builder: adding subview to UIImageView

烈酒焚心 提交于 2019-12-27 17:02:53
问题 I created UIImageView with the help of Interface Bulder. Now I want to place label inside it (as its subview). In code I can type something like: [myUIImageView addSubview:myUILabel]; But can I do it with the help of IB? I found the solution for UIView , but can't find something similar for UIImageView . 回答1: You cannot add a subview to UIImageView in interface builder for reasons only known to Apple! You are right in saying that you can addSubview programmatically, but then, the overhead of

iOS: Custom activity indicator

本秂侑毒 提交于 2019-12-25 18:42:58
问题 I am trying to create custom activity indicator it has two images one image will be static (in the background) and another image will be in the front, it has to move left, right, top and bottom (just to give animation feel). I tried to use the following code (Its wrong one). Can anyone help me, how to do animation UIImage *statusImage = [UIImage imageNamed:@"image1.png"]; UIImageView *activityImageView = [[UIImageView alloc] initWithImage:statusImage]; //Add more images which will be used for

Adding picture frame to a photo

亡梦爱人 提交于 2019-12-25 18:26:28
问题 I am making an app that adds a picture frame to a photo.I would like to know how to have my Save button save both Images (the photo, and the frame) as one Image.Right now it only saves one of the images. In interface builder I have the save action saving the image that is loaded into an ImageView, with the frame ImageView overlaying that image. I'd like to merge the two photos as one, so the save action can save the image with the frame. Thanks! 回答1: In this may need to use the masking in the

Pixelated images on iOS10 when building with Xcode 10

99封情书 提交于 2019-12-25 17:45:22
问题 According to my test I only face this issue when making Archive and uploading it to Fabric or iTunesConnect. It's OK in simulator and on real device in debug. I tried both pdf and png. And I tried to change compression type in assets catalog. Archive on the left, Debug on the right 回答1: Instructions for creating ButtonBarItem images create a PDF file with the dimensions 22 x 22 draw the content with vector tools (do not embedd images into the PDF) use a stroke width of 1pt or 1.5pt drag &

DidRecieveMemoryWarning called after viewDidAppear when displaying large image file

这一生的挚爱 提交于 2019-12-25 16:56:01
问题 My app has terminated due to memory pressure when I load a particular page. I am using an NSURLRequest to get data and load an image. I placed breakpoints throughout my code and traced the first didRecieveMemoryWarning call to right after viewDidAppear. Here is the code I am using to load the image: NSError *error = nil; NSURLResponse *response = nil; NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:self.img]]; NSData *data = [NSURLConnection sendSynchronousRequest

Capturing still image with AVFoundation

依然范特西╮ 提交于 2019-12-25 08:20:35
问题 I'm currently creating a simple application which uses AVFoundation to stream video into a UIImageView . To achieve this, I created an instance of AVCaptureSession() and an AVCaptureSessionPreset() : let input = try AVCaptureDeviceInput(device: device) print(input) if (captureSession.canAddInput(input)) { captureSession.addInput(input) if (captureSession.canAddOutput(sessionOutput)) { captureSession.addOutput(sessionOutput) previewLayer = AVCaptureVideoPreviewLayer(session: captureSession)

unable to load a UIImage in a UIImageView

做~自己de王妃 提交于 2019-12-25 08:19:30
问题 I am developing an iOS app using XCode 4.2 I have a UIImage variable and I am trying to load it in a UIImageView by simply saying imgView=image but I am getting an error saying : expected identifier or '(' can someone please assist thank you Edited : I tried the following code : imgView.image=image; I am getting this error : Property 'image' not found on object of type 'imgView' 回答1: You should set the image of an UIImageView like this: imageView.image = image; Edit: Here is a more detailed

Display image from path in imageView in ios [duplicate]

我是研究僧i 提交于 2019-12-25 07:47:15
问题 This question already has answers here : Loading an Image from documents directory (6 answers) Closed 3 years ago . I have image path and I want to display it in uiimageview, /Users/WTS-New/Library/Developer/CoreSimulator/Devices/F43C‌​26D2-DCFF-4764-AAF0-‌​F6CC7BCDCF5D/data/Co‌​ntainers/Data/Applic‌​ation/8E49D340-7CAC-‌​4031-85BF-9E5C26A1E3‌​7A/Documents/Small-m‌​ario.png How can I get image to displayed? 回答1: Try using below code: Get image path from Image name: NSArray *paths =

XCode Custom Activity Indicator - Hide after UIWebView Loads (webViewDidFinishLoad)

流过昼夜 提交于 2019-12-25 07:32:02
问题 I'm using the code found here http://blog.blackwhale.at/?p=336 to create a custom activityIndicator in the current version of xCode. This code uses a series of .png images in an array and then displays them at the set interval to create an animated loading image that you can then place on the screen (and assuming you can somehow remove it) whenever you want. In my main ViewController.m file I have the following code in my viewDidLoad section : /* --- START CUSTOM ACTIVITY INDICATOR */ /

iOS: How to dynamically add image to a parent view?

为君一笑 提交于 2019-12-25 07:29:21
问题 I've got a main image on the screen, and have an "overlay" UIView placed on top of it with the background color set to Clear Color. I want to dynamically place other images inside the overlay view as follows: UIImage* m_icon = [[UIImage alloc]initWithContentsOfFile:@"icon.png"]; UIImageView *imageView = [[UIImageView alloc] initWithImage:m_icon]; [m_OverlayView addSubview:imageView]; But the icon image isn't showing up. What am I missing? 回答1: You may try: NSString *icon_path = [[NSBundle