uiimageview

Is there any way to stop an image in a UIImageView from lazy loading with SDWebImage on iOS?

与世无争的帅哥 提交于 2019-12-11 08:58:14
问题 I'm using the following code to lazy load an image into my UIImageView: [self.imv1 setImageWithURL:[NSURL URLWithString:myURL] placeholderImage:[UIImage imageNamed:@"loading.png"] completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType) { // stuff here }]; When a user touches a button, I want the lazy loading of this to STOP completely, so that no image gets loaded and the download of the image stops. After I stop the lazy loading, I plan to load a different image into the same

How can I use UIImageView with aspectFill and alignment to the top?

末鹿安然 提交于 2019-12-11 08:54:18
问题 How could I use UIImageView with aspectFill and alignment to the top? Auto-layout or programmatically don't mind. 回答1: It can be done, but you are talking about quite a bit of coding. Let's start with a detailed description of what you are asking for. We'll start with an iPhone6s in portrait mode with a screen size of 667x375 points, or a regular height by compressed width in size classes. (Keep in mind, on any iPad you'll also need to work with slide-over and split screen too.) But for now

Interface Builder / Putting UIButton in front of UIImageView (when UIButtons have been created before UImageView…)

有些话、适合烂在心里 提交于 2019-12-11 08:45:47
问题 I have already defined several buttons in a view with Interface Builder. Now, I would like to add an UIImageView in this view. The idea is to have the UIImageView display behind the already existing buttons. I have dropped a new UIImage View in the view but curiously, I cannot get the image appear under the buttons (buttons are hidden by the fresh UIImageView). When I move my old buttons onto the UIImageView, then they remain in front of them but I guess there is another way to reach what I

How to make a portion of an UIImageView transparent in order to show views in layers below

纵饮孤独 提交于 2019-12-11 08:26:37
问题 Here is a photo explanation to better illustrate what I mean: I have two UIImageViews , with View1 being on the bottom and View2 at the top: What I would like to do accomplish is to programmatically set an area on View2 that is completely transparent (i.e. has an alpha of 0 ), so that this will be the end result: I haven't been able to find a similar problem related to marking a part of a UIImageView transparent in the form of a shape (specifically, a circle), and was wondering how I should

UICollectionViewCell does not show images

≯℡__Kan透↙ 提交于 2019-12-11 08:23:32
问题 How do I get the image shown in the cell, using UICollectionViewCell? Running the below stated code, I get the following output in the debugger. MagazineCell initWithFrame is called and when reloading the data the setPhoto is called. If I would put the setPhoto code in the initWithFrame method a reload would have no effect. But the simulator does only show grey cells. No Image added, no backgroundcolor changed to yellow/red. What do I miss? [5230:70b] -[WebApi getSurroundImages] [Line 326] do

UIImageView, Load UIImage from remote URL

假如想象 提交于 2019-12-11 08:17:10
问题 This problems it's driving me crazy... I have this string url : " verona-api.municipiumstaging.it/system/images/image/image/22/app_1920_1280_4.jpg " and I have to load this image in my imageView . this is my code : do { let url = URL(fileURLWithPath: "http://verona-api.municipiumstaging.it/system/images/image/image/22/app_1920_1280_4.jpg") let data = try Data(contentsOf: url) self.imageView.image = UIImage(data: data) } catch{ print(error) } This throw the exception : No such file or

Read RGBA Image OpenCV

冷暖自知 提交于 2019-12-11 08:11:25
问题 I am stuck with reading, processing and displaying sample.png image which contains RGB and an additional Alpha layer. I have manually removed background in this image and only foreground appears in windows image slideshow propgram. I couldnt find any useful information anywhr... when i read it from opencv usng functions imread or cvloadimage it creates a white background by itself... i have read documentation of highgui which states that these functions only deal wth RGB not RGBA...any help

Only last image is loading from url in scrollview

谁说我不能喝 提交于 2019-12-11 07:58:51
问题 In my iOS app I have have a lots of view and image and labels are the subviews of the. view. My problem is while loading images from url or remote server only last image is loading from url . Other images are loaded with placeholders. Tried many ways but unable to solve it . My code and screenshot are provided below catScrollView=[[UIScrollView alloc]initWithFrame:CGRectMake(0, 10, self.view.frame.size.width,300)]; catScrollView.contentSize = CGSizeMake(([popularCategoryArray count] * 90)/1.8

Image blurring on a UIButton - but not when UIImageView

♀尐吖头ヾ 提交于 2019-12-11 07:46:49
问题 I have a bit of an odd problem with an image I'm using in a UIButton backgroundImage property. As you can see from the picture, the foreground image (in an UIImageView) is much clearer, whereas the background one, is blurred and not as good looking - this is a image on a UIButton. Thoughts? Things to try? Any ideas would be appreciated. I'm doing this all in IB. 回答1: Retina and not retina file sizes were not exactly double. Keep your designers informed guys... 来源: https://stackoverflow.com

Crop image to be circular swift 3

断了今生、忘了曾经 提交于 2019-12-11 07:34:48
问题 So I have this issue I have been trying to solve for the past few days however, cannot find a solution to the problem. My issue is very simple I am trying to crop a image so that it becomes a circle. From research done, I have found a few methods that can be used to achieve this and the main one which seemed to pop up a lot is to simply crop the UIImageView so that it becomes a circular frame. The code which I used to do this can be seen below. imageView.layer.masksToBounds = false imageView