uiimageview

AFNetworking prefetch other images

a 夏天 提交于 2019-12-11 16:54:09
问题 I am using the UIImageView + AFNetworking category to download and display images from an array of URLs and populate a table view. Now I find that the other images are delayed because only the current cell's image will be loaded. I need to keep busy by fetching other images as well. My idea would be to write a for loop and start downloading and caching with AFNetworking, say, 10 other requests starting from current indexPath . Or should I just do the usual dispatch_async in the completion

Reading and editing pixels of image on iPhone

╄→尐↘猪︶ㄣ 提交于 2019-12-11 16:31:08
问题 Curious about how to read and edit a picture's pixels on the iPhone. Am I better of using an array of points with colours? I want to do things like.. if a CGPoint intersects with a "brown" spot on the picture, set the colour of all brown pixels in a radius to white. More questions to come, but this is a start. Cheers 回答1: The picture data is available to you as precisely that -- a two-dimensional array of pixels, each pixel being represented by a 32 bit integer. For each of the color

How do I animate a UIImageView left to right with UIPageControl?

心不动则不痛 提交于 2019-12-11 16:20:11
问题 I want to animate a UIImageView left to right with UIPageControl. I have this code but it seems a bit odd...Specifically because what would I do when I reach image 3? I would have to return and that would mess up the mathematical calculations of the views in the pageControl array the way I have it set up: -(void)createUIViews{ UIImage *image1 = [UIImage imageNamed:@"GiftCard.png"]; firstView = [[UIImageView alloc] initWithImage:image1]; firstView.backgroundColor = [UIColor grayColor];

Declaring an array of UIImageViews globally in Xcode

旧城冷巷雨未停 提交于 2019-12-11 16:16:00
问题 I created an array of ImageViews in a Buttonclicked method: UIImageView *arrayOfImageViews[10] I successfully loaded them on the screen using a loop. (Big accomplishment for this beginner!) But I want to refer to them in other methods (e.g. touchMove ). Where do I declare arrayOfImageViews to be both an array and a class of UIImageView so that I can use them in other methods? From what I can find, I'm to declare them in the .h and above Implementation in the .m . But I can't figure out the

Want fixed orientation, but the UIImage autoratate

人走茶凉 提交于 2019-12-11 15:56:05
问题 I am confused about the UIImage orientation in my iOS design. I simply load an image taken by my iPhone into UIImageView using storyboard and expect it would be shown exactly the same in the simulator. However, it rotates. (I choose the content mode to be aspect fit) I try with other images downloaded from the internet all of them works fine but the one was taken by the camera. Anyone have any idea why this happens? edit: I try to print out imageOrientation property my example. It shows 0

UIImage and UIImageView problem

喜你入骨 提交于 2019-12-11 15:55:51
问题 set a UIImageView.image property to a UIImage is unable add the image to the view,however if i set the imageview frame property,it works.can anyone tell me how it's happen? and what will happen when i apply the UIImage instance method[drawInRect:] redraw the image frame which is larger than the view frame?i have tried but nothing happen,and what is this function doing actual? 回答1: Generally, how it works is, you add an Image to a UIImageView and then add the UIImageView to a UIView to display

UIImageView image not showing up

前提是你 提交于 2019-12-11 15:47:29
问题 _topBar = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 320, 45)]; UIImageView *bar = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"top_bar.png"]]; bar.frame = CGRectMake(0, 0, 320, 45); [_topBar addSubview:bar]; _up = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"up.png"]]; [_topBar addSubview:_up]; _up does not show up in my build. If i exchange the "up.png" for any other image in my resources folder, it shows up, but up.png refuses to. Is there anything I can do? I've

iPhone SDK: Download and Set UIImageView before first view controller is displayed

爱⌒轻易说出口 提交于 2019-12-11 15:25:31
问题 I am having trouble getting a UIImage to display instantly after the app has finished loading and displays the first view controller. There is a delay in the displaying of the image due to it being downloaded from the web. Is there any method that gets called before applicationDidFnishLaunching so the image can be downloaded and displayed instantly ? Here is the code that I am using to download the images: In delegate, this method is called in appDidFinishLaunching: -(void)downloadImages {

Gradient not covering full frame SWIFT

随声附和 提交于 2019-12-11 15:16:52
问题 I have the following extension to imageView : extension UIImageView { func addBlackGradientLayer(frame: CGRect){ let gradient = CAGradientLayer() gradient.frame = frame gradient.colors = [UIColor.clear.cgColor, UIColor.black.cgColor] gradient.locations = [0.0, 1.0] self.layer.addSublayer(gradient) }} imageView.addBlackGradientLayer(frame: imageView.frame) on applying this to the imageView, I am having the following output. I tried setting the constraints and also, the autolayout. Following is

Problem setting UIImageView Image

浪子不回头ぞ 提交于 2019-12-11 14:59:03
问题 I am trying to set my imageview: detailedEventViewController.thumbnail.image = [UIImage imageNamed:@"amnesia.png"]; but get the error: 2011-01-08 09:53:24.153 HD Pocket Vacations[24697:207] -[DetailedEventViewController thumbnail]: unrecognized selector sent to instance 0x624d820 2011-01-08 09:53:24.247 HD Pocket Vacations[24697:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[DetailedEventViewController thumbnail]: unrecognized selector sent to