uiimageview

UIImageView renders image differently to original

我的未来我决定 提交于 2019-12-11 07:05:02
问题 The image on the right is the one that I produced in photoshop. I then stripped all text and put it in an image view, as soon as I did that there was a change in colour and the vertical line lost it sharpness. Has anyone else run into a similar problem? What do I do? alt text http://grab.by/1DuZ 回答1: Are the dimensions correct? Is the position of the image an integer? If these cases antialiasing will slightly blur your image. 回答2: One thing to be careful of is that if your image is an odd

ios uiimageview tap gesture not working during animation

ⅰ亾dé卋堺 提交于 2019-12-11 06:59:05
问题 I have a UIImageView that is animated and receiving a UITapGestureRecognizer . The problem is while animated, the tap gesture area doesn't move with the view. I can tap the view's original location and the tap gesture is recognized. Anyone know how to have the tap recognized while the view is moving and not at its original position? Edit 1: This is how I've set up my tap gesture recognizer: UITapGestureRecognizer *tapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:

Getting image name from uiimageview

南楼画角 提交于 2019-12-11 06:54:23
问题 I want to get the particular image name by touching inside of that image. Can any one give me the sample code for that? 回答1: Nick Weaver is correct. There is still a way to do it, though. Create an array with the names of the images. Set the tag property of each UIImageView so it corresponds to the names in the array. Then, access the array via the tag property. NSArray *nameArray = [NSArray arrayWithObjects:@"image1", @"image2", nil]; //touch happened NSString *imageName = [nameArray

Implementing UITapGestureRecognizer directly into UIView instead of ViewController does not work

爱⌒轻易说出口 提交于 2019-12-11 06:51:40
问题 As explained in this SO-answer I am trying to implement UITapGestureRecognizer in a subclass of UIIMageView . My approach can be found below. An instance of MenuButtonImageView is a subview of homeScreenViewController.view . I implemented touchesBegan:withEvent: , touchesMoved:withEvent: and touchesEnded:withEvent: too and do work fine. Problem : Somehow handleSingleFingeredTap: is never called. What could be the problem with this? @interface MenuButtonImageView : UIImageView @property

merging uilabel and uiimageview

谁说我不能喝 提交于 2019-12-11 06:04:16
问题 I picked an image from the photo album and put it in an UIImageView called imageView I then added some text over the image using UITextView as source of input and a UILabel on top of the uiimageview to display the text. So far so good. Now I'm trying to merge the label and the imageview in order to do other stuff with that but I 'm not getting it to work. I have tried some solutions given to similar questions but they didn't work for me. I tried this UIGraphicsBeginImageContextWithOptions(

issue while dropping pin to imageview on different devices

耗尽温柔 提交于 2019-12-11 05:56:39
问题 i am dropping pin image on imageview with coordinates so pin set correctly but there is minor position difference in various devices i am sharing my code below func convertTapToImg(_ point: CGPoint) -> CGPoint? { let xRatio = imgView.frame.width / (img?.size.width)! let yRatio = imgView.frame.height / (img?.size.height)! let ratio = min(xRatio, yRatio) let imgWidth = (img?.size.width)! * ratio let imgHeight = (img?.size.height)! * ratio var tap = point var borderWidth: CGFloat = 0 var

Translucent , setStatusBarStyle, UIWebView

送分小仙女□ 提交于 2019-12-11 05:37:10
问题 I'm working on the UIWebView and what I want is for the webView not to over rap the view. so here is the question. I set the UIWebView ,and the status bar is overlaid over the content. How can I handle this? I coded as when I made the UIImage view, but at that time there is the navigation bar, and it worked well. Also I did setFrame:CGRectMake(0, 20).... but also doesn't work. why the [ setFrame]; method doesn't work? Any ideas please. #import "ViewController.h" @interface ViewController ()

iOS 5 ARC lazy image loading library

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-11 05:32:37
问题 Is there an iOS 5 arc compatible lazy Image loading library? I've not found one. My next thought is to make EGOlazyloading a compiled library and link it to my project. Would that work? Any pointers on going about? Thanks! 回答1: I wrote one. You can download it here: https://github.com/nicklockwood/AsyncImageView Alternatively, if you do want to use EGO, or some other library, select Edit>Refactor>Convert to ARC and in the dialog that comes up there's a little drop down to select which files

iOS - Zooming UIImageView on a UIScrollView

最后都变了- 提交于 2019-12-11 05:16:24
问题 I'm making a picture gallery, with an amount of UIImageView inside UIScrollViews, inside a main UIScrollView. The gallery allows to change horizontally the pictures, and doing zoom on each one. It works fine in general, but the animation of zooming is not working good at all. The problem appears when the image is small and not filling all the screen. When you make bigger the image, but not until filling the full gallery, the image suffers a little displacement, that I correct with the next

UIImageView setFrame: not working in UITableViewCell

谁说胖子不能爱 提交于 2019-12-11 05:14:02
问题 I've an UIImageView in customized UITableViewCell and I want to resize it, I set it view mode to LEFT. To resize I'm applying below code. [cell.IBImage setFrame:CGRectMake(201,12,50,20)]; My image width is 100 and I want to reduce is to 50 but it still shows me in 100 width. If I set view mode to Scale To Fill it works fine but I want to have it's view mode to LEFT. Full method cellForRowAtIndexPath is as given below: - (UITableViewCell *)tableView:(UITableView *)tableView