uiimageview

how to darken a UIImageView

喜夏-厌秋 提交于 2019-12-22 05:20:41
问题 I need to darken a UIImageView when it gets touched, almost exactly like icons on the springboard (home screen). Should I be added UIView with a 0.5 alpha and black background. This seems clumsy. Should I be using Layers or something (CALayers). 回答1: How about subclassing UIView and adding a UIImage ivar (called image)? Then you could override -drawRect: something like this, provided you had a boolean ivar called pressed that was set while touched. - (void)drawRect:(CGRect)rect { [image

Rendering mode set to Template for vector pdf in image catalogue, but UIImageView wont tint the image in a custom cell

喜你入骨 提交于 2019-12-22 04:54:10
问题 I have migrated all my image files to the asset catalogue. All of them are pdf vectors of size 1x. They are set to render as a Template. They show up fine everywhere in size and in color. But there is this one custom TableView Cell from a xib that I has 6 UIImageView s linking to 6 of these images from the catalogue. Somehow they don't respect the tint color, neither default nor custom. Tried changing them programmatically but didn't work either. These same images show up fine in another

Adjusting the line to fit our head in imageview

六月ゝ 毕业季﹏ 提交于 2019-12-22 03:43:22
问题 I am developing one application same as HairTryOn all things are done. but problem is display in following image. i want to set hair style as per customer face using blue line as per display in image. i used the following code testVw = [[UIView alloc]initWithFrame:CGRectMake(100,100, 100, 100)]; testVw.backgroundColor = [UIColor clearColor]; [self.view addSubview:testVw]; resizeVw = [[UIImageView alloc]initWithFrame:CGRectMake(testVw.frame.size.width-25, testVw.frame.size.height-25, 25, 25)];

How do I set the background of UIScrollView to be transparent?

若如初见. 提交于 2019-12-22 03:22:36
问题 What i ultimately would LOVE to do is having my scroll view contents scrolling (in the scroll view control), and have a static background (a wallpaper image). I've tried a combination of things, none of which really yields what im looking for, not even close really. Has anybody attempted this before? 回答1: This is actually very easy, a UIScrollView inherits from a UIView so you just need to set the backgroundColor property: aScrollView.backgroundColor = [UIColor clearColor]; The above line of

iphone refresh images UIImageView

倖福魔咒の 提交于 2019-12-22 00:57:15
问题 I have a rather basic question. I have several(5) UIImageView images on my screen. When I click a button, I want to change each image to something else. I also want to play a sound as each image is changed. So I basically want a clicking sound as each image changes. The problem is, for some reason if I have say 5 images, the sound gets played 5 times first and then the images change. It's like the images only refresh when control goes back to the user for input. How can I "force" it to

How to smoothen the edges of a UIImageView in iOs [duplicate]

南笙酒味 提交于 2019-12-21 23:31:32
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: Any quick and dirty anti-aliasing techniques for a rotated UIImageView? I wanted to change the angle of an UIImageView in my iPhone and app i used the following code: previewImg.transform = CGAffineTransformMakeRotation(atan2(y2-y1,x2-x1)); and I got it working and the image is below. In the image, the edges of the image is not smooth. Is there any way to smoothen the edges? 回答1: This has been asked before,

How to animate drawing in Swift, but also change a UIImageView's scale?

余生颓废 提交于 2019-12-21 23:18:42
问题 I'd like to animate a drawing sequence. My code draws a spiral into a UIImageView.image. The sequence changes the image contents, but also changes the scale of the surrounding UIImageView. The code is parameterized for the number of revolutions of the spiral: func drawSpiral(rotations:Double) { let scale = scaleFactor(rotations) // do some math to figure the best scale UIGraphicsBeginImageContextWithOptions(mainImageView.bounds.size, false, 0.0) let context = UIGraphicsGetCurrentContext()!

How to load image asynchronously with Swift using UIImageViewExtension and preventing duplicate images or wrong Images loaded to cells

孤街醉人 提交于 2019-12-21 23:14:46
问题 Im developing an image loading library in Swift 4 something like Kingfisher with some extensions to support loading images from URL into an UIImageView . So then i can use this extension on a UICollection or UITableview cell with an UIImageView like this : let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "collectioncell", for: indexPath) if let normal = cell as? CollectionViewCell { normal.imagview.loadImage(fromURL:imageURLstrings[indexPath.row]) } Basically this is my

how to add on touch and detect UIImageView on view so i could move it around and not adding one on top of it?

假如想象 提交于 2019-12-21 23:11:31
问题 i wonder if you guys have a sample code adding and move UIImageView on touch and also detect if there is an UIImageView there so i can't add UIImageView on top of it. EDIT: clearer question 1. i wanna add an cups(UIImageView) when i touch the view but do not wan the cup(UIImageView) to stack. i wanna move the UIImageView but will bounce back to the original position if there is an UIImageView there so it will not stack the UIImageView already there. thanks for reading my question and

UIImageView's layer border visible inset

半腔热情 提交于 2019-12-21 22:24:21
问题 Just did this: self.imageView.backgroundColor = color1; self.imageView.layer.masksToBounds = YES; self.imageView.layer.borderColor = color1; self.imageView.layer.borderWidth = 3.0; Here is screenshot of the problem: I can see image, borders, and image fragments out of the border… How can I fix it? 回答1: I had a similar issue using the border properties on the layer and managed to solve it by adding a CAShapeLayer on top. I can't tell you how it will behave on older devices as haven't tested it