uiimageview

Add a CALayer sublayer centered over UIImageView

蓝咒 提交于 2019-12-12 10:48:12
问题 Xcode 7.2 Swift 2 I am trying to overlay an Image with what I am calling a "BlurFilterMask". It is a CALayer that I dynamically add with Swift Code, here is the BlurFilterMask: class BlurFilterMask : CALayer { private let GRADIENT_WIDTH : CGFloat = 50.0 var origin : CGPoint = CGPointZero { didSet { setNeedsDisplay() } } var diameter : CGFloat = 50.0 { didSet { setNeedsDisplay() } } override init() { super.init() } required init?(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been

iOS showing Image from ALAsset in UITableView

大城市里の小女人 提交于 2019-12-12 09:26:27
问题 I have a db where items are stored. These items can be different kinds of type like text, videos and images. When the View is loaded I fetch these items from the DB and I show them in a UITableView. The problem I am facing is related to show the images in the table view. Basically in the DB I store the ALAsset link related to the picture and from it I try to get its image using this code: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ /

Swift UIView with multiply effect

柔情痞子 提交于 2019-12-12 09:16:42
问题 What I've been trying to achieve for a couple of hours is something like the following: I would like to have a UIImage in the background and then preferably a UIView with a background color of red with some kind of multiply effect (the red area). Is this possible? I've seen a few extensions for UIImage that tints them, but that would only work if I wanted my WHOLE image to have a red multiply color effect. Thanks 回答1: You could just add a red UIView to the top of your UIImageView . Adjust the

iPhone Camera - Choose from Library or Take Photo

旧巷老猫 提交于 2019-12-12 08:58:15
问题 Please look at the image below !! So in this image... You can see a pop-up from the bottom which gives the user 3 options when he 'taps' the 'Camera' button. What is that view ? Is it a modal view controller which gets dismissed when an option is selected ? Edit: So it is UIActionSheet ! I have one more question on this, but StackOverflow would love it if I could edit the question rather than putting up a new one. So yes.. The option "Take Photo" uses the UIImagePickerController, and the

select part of image (clipping)

荒凉一梦 提交于 2019-12-12 08:14:04
问题 This is probably not as hard as I think it is, but how can I select part of an image? Consider the following example: The grey area is an image in the PNG or JPG Format, now I want to select the red 80x80 px area from it. The red area should be displayed, the rest not. I have tried numerous approaches: Make clipsToBounds of UIImageView to YES and the try to offset the image (doesn't work) Clip the upper view (doesn't work) I also had a look at the drawing functions, yet I have not worked with

Displaying interlaced (progressive) Image in UIImageView

时光总嘲笑我的痴心妄想 提交于 2019-12-12 07:48:32
问题 I am trying to display a JPEG image as it downloads, using part of the data, similiar to many web browsers do, or the facebook app. there is a low-quality version of the image(just part of the data) and then display the full image in full quality. this is best shown in the VIDEO HERE I followed this SO question: How do I display a progressive JPEG in an UIImageView while it is being downloaded? but all I got was a imageview that is being rendered as data keeps comes in, no low-quality version

how to make Designable UIImage in Swift

a 夏天 提交于 2019-12-12 07:25:29
问题 I am a beginner. I want to make a swift file that contains a code to make Designable UIImage, so I will not edit the UI element display by coding, just in Interface builder by assigning this swift file to UI class. I can do something similar in UIButton, for example if i want to make round corner and add border to UIButton i can do something like this import UIKit @IBDesignable class DesignableButton: UIButton { @IBInspectable var cornerRadiusOfButton : CGFloat = 0 { didSet { layer

Setting uiimage to nil doesn't release memory with ARC

99封情书 提交于 2019-12-12 07:19:28
问题 I have a scrollview that shows different images as it's scrolled through the pages, like PhotoScroller. I'm using ARC. When someone scrolls to another page, I set the image property of the UIImageView not being currently show to nil, as (attempting) to avoid memory crashes, which are still happening. Then when the user scrolls to a new page, the image for that page is set as the UIImageView's image property, as well as the page before and after it (for smooth viewing). The UIImage's for the

How to add a delay to a loop?

大憨熊 提交于 2019-12-12 07:08:26
问题 Im attempting add image views to a UIView using this code: for (int i = 0; i <numberOfImages; i++) { UIImageView *image = [UIImageView alloc]initWithFrame:CGRectMake(40, 40, 40, 40)]; image.image = [images objectAtIndex:i]; [self.view addSubview:image]; } This works but the problem is I would like to have a 5 second delay before it adds each image, instead it adds them all at the same time. Can anybody help me out? Thanks. Example: 5 seconds = one image on screen 10 seconds = two images on

iPhone - Knowing when an UIImageView has loaded its image

早过忘川 提交于 2019-12-12 06:36:55
问题 I'm loading a 5MP image into an UIImageView calling self.imagecontainer.image = myUIImage . myUIImage is an image coming from the camera of the iPhone. This takes some time before the image can be seen on screen, and even if I can reduce this time, I need to start a process when the image is really displayed on the screen. How may I know that the image is loaded and displayed, and not just still being processed by the UIImageView ? 回答1: Well... first thing is you shouldn't be setting a 5MP