uiimageview

“This application is modifying the autolayout engine from a background thread”

不羁岁月 提交于 2019-12-06 08:25:36
问题 I am having an error of: This application is modifying the autolayout engine from a background thread, which can lead to engine corruption and weird crashes whenever I try to load an image view into a table view. The relevant code is as follows: override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { let cellIdentifier = "ArticleCell" let cell = tableView.dequeueReusableCellWithIdentifier(cellIdentifier, forIndexPath: indexPath) as!

Animating a UIImageView tint

馋奶兔 提交于 2019-12-06 08:23:54
问题 Similar to this previous question, I want to apply an arbitrarly-coloured tint to an arbitrary image (a UIImageView ). However, I want the tint to fade away over N seconds of time, to have a "pulse" effect. I'll be triggering the pulse every M seconds. While I think I could rig up a naive solution using an NSTimer to change the tint, I think I can probably use some of the Core Animation framework to have a much more elegant (and efficient) solution. However, I'm not very familiar with Core

iOS: Image view aspect fit with corner radius

喜夏-厌秋 提交于 2019-12-06 08:00:57
I want to set corner radius with content mode as aspect fit using following code: cell.imgvAlbum.contentMode = UIViewContentModeScaleAspectFit; cell.imgvAlbum.clipsToBounds = YES; cell.imgvAlbum.layer.cornerRadius = 5.0f; but i am getting output only for content mode as aspect fit. I have also tried for: cell.imgvAlbum.layer.masksToBounds = YES; What to do for corner radius? Please suggest me some solution. Thanks in advance. Use below method to get a Rounded corner image with the specified radius for rounded corner, apply all your above properties as UIViewContentModeScaleAspectFit , clip to

Prevent UIScrollView from moving contents to top-left

我的梦境 提交于 2019-12-06 07:52:45
问题 I have a UIImageView contained within a UIScrollView . The image is (usually) big, so the user can zoom it out in order to see the whole thing. Upon zooming out, though, UIScrollView snaps the ImageView to the top-left of the scrollview. I want this to be positionable by the user, and haven't found a way to "turn it off" yet. It's kinda like always allowing scrolling, rather then only allowing scrolling when the image is zoomed in. Maybe it's too major of a change? Anyone know of a way?

UIView Frame Size Didn't Change UIImageView Placed inside it

北战南征 提交于 2019-12-06 07:25:13
I'm making a picture in a frame and then user can resize the frame size in runtime. For this purpose I've made a custom UIView in my main UIViewController and inside this UIView I've placed 2 UIImageView . In Document Outline Pane of xCode it's hierarchy is: View |--ImageView |--ImageView I'm using this line of code to change size of UIView under different conditions it'll resize accordingly: self.imageObject.frame = CGRectMake(self.imageObject.frame.origin.x , self.imageObject.frame.origin.y, 200, 200); imageObject is my UIView . When I run it the size of the UIView changes but UIImageView

Transparent Circle at Middle of UIImageView IOS

旧巷老猫 提交于 2019-12-06 07:14:44
I need to make UIImageView transparent at the Middle Position(Round Circle ..See attached image) I should be able to see the Behind Subviews of UIImageView via that middle circle...i tried CAShapeLayer..but i am not able to see the behind subviews of UIImageView..Please help me..Sorry for my English.... CAShapeLayer *circleLayer = [CAShapeLayer layer]; // Give the layer the same bounds as your image view [circleLayer setBounds:CGRectMake(100.0f, 100.0f, [((UIImageView *)view) bounds].size.width, [((UIImageView *)view) bounds].size.height)]; // Position the circle anywhere you like, but this

Creating subclass of UIImageView

眉间皱痕 提交于 2019-12-06 06:38:37
I havent found the option of UIImageView to choose from dropdown during creating objective-c class. I am using xcode 4.3. I want to know arent we allowed to extend UIImageView class. Or do i have to inherit UIView ? Any sample structure of custom UIImageView class would be helpful. Thanks pasawaya I believe it's considered bad practice to subclass UIImageView. If you take a look at this question, there are many examples of why you shouldn't do it: A part of the Gang of Fours design pattern philosophy is to "Favor 'object composition' over 'class inheritance'." This reduces the tight coupling

Strange UITableViewCellStyleSubtitle + [cell imageView] behaviors

冷暖自知 提交于 2019-12-06 06:29:05
This question's been bugging me for a month and i've been resisting posting about it, but I can hold out no longer. Here's what's going on: I have an app with UITableViewCell s, all initialized as UITableViewCellStyleDefault . For each one, I am setting the image view's image using the excellent SDWebImage package, which extends UIImageView to have a method for [UIImageView setImageWithURL:(NSURL*)url placeholderImage:(UIImage*)image]. The problem is that the images are showing up more narrow than they should be, on the tableView, but for some reason selecting a row makes it the correct size.

Corner radius image Swift

若如初见. 提交于 2019-12-06 06:24:30
问题 I'm trying to make this corner radius image...it's not exactly the same shape of the image..any easy answer instead of trying random numbers of width and height ? thanks alot let rectShape = CAShapeLayer() rectShape.bounds = self.mainImg.frame rectShape.position = self.mainImg.center rectShape.path = UIBezierPath(roundedRect: self.mainImg.bounds, byRoundingCorners: [.bottomLeft , .bottomRight ], cornerRadii: CGSize(width: 50, height: 4)).cgPath 回答1: You can use QuadCurve to get the design you

UIImageView Resizing / Scaling - SWIFT

烂漫一生 提交于 2019-12-06 05:46:05
I have a UIImageView that's size(width = screensize, height = 239). I now download an image that is size(width = 1366 and height = 445). I can't use Aspect Fit (because of white background) or Scale (screws up the aspect ratio). I do want to use Aspect Fill and align it in a specific way - i.e. aspect fill on right aligned or aspect fill on left aligned. Does anyone know how to do this? I've used different libraries like Toucan but I can't seem to get it to work. Thanks a bunch SO. You can use SDWebImage or Kingfisher to show placeholder image and for caching... Then in its completion block