uiimageview

Custom UITableViewCell with large UIImageView causing scroll lag

无人久伴 提交于 2019-12-18 10:17:14
问题 I have a custom UITableViewCell that consists of a UIImageView and a UILabel. The cell is 320x104px and the imageView takes up the whole area with the label in front. There are only 8 cells. in ViewDidLoad I am creating all needed images up front and caching them in a dictionary at the correct dimensions. When I scroll the UITableView there is a noticable lag every time a new cell is encountered. This makes no sense to me as the image it is using is already created and cached. All that I'm

Create UIImage from shadowed view while retaining alpha?

一世执手 提交于 2019-12-18 09:35:23
问题 I have a somewhat unusual problem. In my app, I am shadowing a UIImageView using basic Quartz2d layer shadowing. Here's my code: imageView.layer.shadowOpacity = 1.0; // Pretty self explanatory imageView.layer.shadowRadius = 8.0; // My softness imageView.layer.shadowColor = [UIColor blackColor].CGColor; // Color of the shadow imageView.layer.shadowOffset = CGSizeMake(0.0, 0.0); // Offset of the shadow This produces a nice blur behind the image view. However, I am doing some animation with this

In iOS, how do you preserve sharp edges when enlarging a bitmap?

大兔子大兔子 提交于 2019-12-18 09:30:44
问题 When you put a UIImage into a UIImageView that is smaller than the view, and the content mode of the view is ScaleToFit , iOS enlarges the bitmap, as expected. What I have never expected is that it blurs the edges of the pixels it has scaled-up. I can see this might be a nice touch if you're looking at photographs, but in many other cases I want to see those nasty, hard, straight edges! Does anyone know how you can configure a UIImage or UIImageView to enlarge with sharp pixel edges? That is:

iOS - Retrieve and display an image from Parse in UIImageView (Swift 1.2 Error)

时间秒杀一切 提交于 2019-12-18 08:48:24
问题 I have previously been retrieving an image form my Parse backend to display in my app inside a UIImageView using the following lines of code: let userPicture = PFUser.currentUser()["picture"] as PFFile userPicture.getDataInBackgroundWithBlock { (imageData:NSData, error:NSError) -> Void in if (error == nil) { self.dpImage.image = UIImage(data:imageData) } } But I get the error: 'AnyObject?' is not convertible to 'PFFile'; did you mean to use 'as!' to force downcast? The 'helpful' Apple fix-it

Extract a part of UIImageView

北慕城南 提交于 2019-12-18 07:15:29
问题 I was wondering if it's possible to "extract" a part of UIImageView . For example, I select using Warp Affine a part of the UIImageView and I know the selected part frame . like in this image: Is it possible to get from the original UIImageView only the selected part without losing quality? 回答1: Get the snapshot of the view via category method: @implementation UIView(Snapshot) -(UIImage*)makeSnapshot { CGRect wholeRect = self.bounds; UIGraphicsBeginImageContextWithOptions(wholeRect.size, YES,

Taking time to load the image from URL to UIImageview

半腔热情 提交于 2019-12-18 07:15:24
问题 I am using this code for displaying the image from URL to UIImageview UIImageView *myview=[[UIImageView alloc]init]; myview.frame = CGRectMake(50, 50, 320, 480); NSURL *imgURL=[[NSURL alloc]initWithString:@"http://soccerlens.com/files/2011/03/chelsea-1112-home.png"]; NSData *imgdata=[[NSData alloc]initWithContentsOfURL:imgURL]; UIImage *image=[[UIImage alloc]initWithData:imgdata]; myview.image=image; [self.view addSubview:myview]; But the problem is that its taking too long time to display

Extract a part of UIImageView

和自甴很熟 提交于 2019-12-18 07:15:03
问题 I was wondering if it's possible to "extract" a part of UIImageView . For example, I select using Warp Affine a part of the UIImageView and I know the selected part frame . like in this image: Is it possible to get from the original UIImageView only the selected part without losing quality? 回答1: Get the snapshot of the view via category method: @implementation UIView(Snapshot) -(UIImage*)makeSnapshot { CGRect wholeRect = self.bounds; UIGraphicsBeginImageContextWithOptions(wholeRect.size, YES,

Determine which of its animationImages a UIImageView is displaying?

只愿长相守 提交于 2019-12-18 06:57:19
问题 Is there a way to find out which frame of its animation a UIImage is on? When you start it you give it an array of animationImages, so it clearly has to be storing the index of the current image somewhere. Do you know how I can find this out? Also, is there a way to tell a UIImageView which frame to start its animation on? 回答1: I couldn't find neither a property in the documentation, nor a suspicious ivar or private method after class-dumping UIKit, so the best I could think of is: NSDate

How to make my sprite kit scene appear above a UIView?

送分小仙女□ 提交于 2019-12-18 06:48:43
问题 I've done some searching but haven't found anything directly addressing my issue: I have an SKScene with several SKNodes each with SKSpriteNode objects for my game, and I am using a background UIImageView (there are some things I need to do with background that cannot be reasonable done with sprite kit - to my knowledge at least); the problem I'm having is that the UIImageView appears above everything and I can't see my game objects. In my view controller (.m file) I have the following code

iOS: TapGestureRecognizer Issues

社会主义新天地 提交于 2019-12-18 05:29:10
问题 So I have an app that behaves like a photo gallery and I'm implementing the ability for the user to delete the images. Here is the setup: I have 9 UIImageViews, imageView, imageView2, etc. I also have an "Edit" button, and a tapGesture action method. I dragged a Tap Gesture Recognizer over onto my view in IB, and attached it to each one of the UIImageViews. I also attached the tapGesture action method to each of the UIImageViews. Ideally, I would like the method to only become active when the