uiimageview

How do I get cached image stored by AFNetworking's UIImageView category?

廉价感情. 提交于 2019-12-12 04:16:40
问题 I'm using following category UIImageView+AFNetworking.h from AFNetworking in my app, its working fine, its caching photos for me and loads images smoothly. At one point, I want to get an image which is already there in my cache. So I dig up into above category class where I found following code, which I think – can be helpful. Here's the snippet from it: @implementation AFImageCache - (UIImage *)cachedImageForRequest:(NSURLRequest *)request { switch ([request cachePolicy]) { case

Create a UIImage from another view controller

女生的网名这么多〃 提交于 2019-12-12 04:10:03
问题 How does one create a UIImage within one viewcontroller, when the action which I want to trigger the creation is a button in another viewcontroller? So I would like to have a button in a viewcontroller, which when pressed, dismisses this view and create a UIImage in the other view. How is this done? Thanks 回答1: You can keep a reference to the image-holding VC in the button-holding VC. An instance variable (e.g. otherViewController) seems suitable. In the first VC, you implement a method that

Add checkmark image in cell in Collectionview issue iOS

六月ゝ 毕业季﹏ 提交于 2019-12-12 04:09:33
问题 I tried to add checkmark image to cell but i have a problem, i just select 1 cell although i set the multiselection = YES for collectionview. And 1 more issue is when I scroll the collectionview, the selected cell is reuse, all checkmark images is incorrect. Below is the code i'm using. - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { TDPhotoCell *photoCell = [collectionView dequeueReusableCellWithReuseIdentifier

Place an image on top of another image

我的未来我决定 提交于 2019-12-12 03:58:05
问题 What I want to do is the following. A user can take a picture with the iPhone camera. After the picture is taking their will be another image placed on top of the taken picture. also the image that is placed on top should rotate a 25°. Besides the rotation I also need to lower that image on top a little bit below the taken picture. You can see what I mean over here. I have the following. -(UIImage *)drawImage:(UIImage*)profileImage withBadge:(UIImage *)badge {

Why do UIView & UIImageView animate differently?

时间秒杀一切 提交于 2019-12-12 03:56:02
问题 I have 4 buttons, all use the same animate func imageViewWithoutDelay imageViewWithDelay ViewWithoutDelay ViewWithDelay my code: import UIKit class ViewController: UIViewController { @IBAction func imageViewithoutDelay(_ sender: AnyObject) { let circleImage = UIImageView() // kindly add your own image. circleImage.image = UIImage(named: "empty") animate(inputView: circleImage, delay: false) } @IBAction func imageViewWithDelay(_ sender: UIButton) { let circleImage = UIImageView() circleImage

how to move a layer by dragging?

﹥>﹥吖頭↗ 提交于 2019-12-12 03:55:13
问题 How to move a layer by dragging after I added the CATextLayer to UIImageView Layer. As I will add more than one layer to UIImageView. So, How can I know which layer I clicked and move it to another position? Here is my code for drawing text: func addText() -> CATextLayer{ let rect:CGRect = CGRect(x: 50, y: 600, width: 120, height: 60) let myAttributes = [ NSFontAttributeName: UIFont(name: "HelveticaNeue-Thin", size:18)!, NSForegroundColorAttributeName: UIColor.black.cgColor ] as [String : Any

UIImageview rotation is not working when using CGAffineTransformMakeRotation

南笙酒味 提交于 2019-12-12 03:53:30
问题 I am rotating UIImageView with CGAffineTransformMakeRotation . Rotation is working fine. When I tried to get that image to another UIImageView , rotation is not working. Coding 1: @IBAction func rotateAcn(sender: UIButton) { rotatingImageVw.transform = CGAffineTransformMakeRotation(0.22) } Output 1 Coding 2: @IBAction func getRotatedImage(sender: UIButton) { newImageView.image = rotatingImageVw.image } Output 2 I dont know why this happening? I need Output 2 as in Output 1 . Kindly guide me

How to align only the title in UIAlertView

对着背影说爱祢 提交于 2019-12-12 03:52:08
问题 I would like to align center only the title in UIAlertView, while the message should be align left. Currently I am doing ((UILabel*)[[alert subviews] objectAtIndex:1]).textAlignment = NSTextAlignmentCenter; But it aligns center also the message. 回答1: I wouldn't try to modify the default labels of the UIAlertView, instead you should create a new UILabel and add it as a subview. UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Centered Title" message:@"\n\n\n" delegate:self

How to Passing Uiimage from one view controller to Other view controller when using popvivew controller used?

☆樱花仙子☆ 提交于 2019-12-12 03:48:41
问题 I Have Two View controllers. First UIViewController contain one UIImage, when I click "crop" button, go to second view controller I pass the image by push view controller, here I'am cropping my UIImage. In second UIViewController after cropping my image, clicking "done" button, I need to pass the cropped image to first view. Problem is when I use pop-view controller, image is not passing. 回答1: Try like this. First view controller should have a property @property (assign)UIImage *croppedImage;

How recognize which UIImageview I've tapped?

允我心安 提交于 2019-12-12 03:47:14
问题 I want to realize a sort of matrix editable by touch. A series of black or white cell that if tapped switch form black to withe or viceversa. For doing this i will use UIImageView arranged in stack view a Tap Gesture Recognizer. But how do I know which UIImageView was tapped? And in which way I can change the UIImage in the UIImageView? 回答1: If they are just white and black, it would be much simpler to use a UIView and set its backgroundColor to .white or .black . You can use the tag property