How to reset the image in UIImageView without loading the whole view?
UIImageView *imageView;
imageView.image=[UIImage imageNamed:@"one.png"];
refresh with orignal image. Have u tried this
[imageView reloadInputViews];
If it not work try this code again to refresh
imageView.image=[UIImage imageNamed:@"one.png"];
Naveen Chauhan
I am hard working because i want to become a valuable mobile developer which needs lots of hard work. I am dedicated to work because i love my profession. I am a Mobile Developer with 2+ years of experience(1 year in PHP and 1+ year in iOS and Android).
Updated on July 09, 2022Comments
-
Naveen Chauhan almost 2 years
I have a xib which has 1 UIImageView and 1 Toolbar. Toolbar has two buttons save and reset.
In the simulator i can make some drawing on the image in the UIImageView. Now i want that if i click on the reset button then i would get the original image if i didn't save the changes on the image. I don't want to load the entire view again. Only I need to replace my edited image with original image? Can you please guide me that how can i do this stuff? -
Naveen Chauhan over 12 yearsI have tried this. But i didn't work. I want to change the image in UIImageView of my nib file. Here you are creating a new UIImageView.
-
Shahab Qureshi over 12 yearsmyImageView.image = [UIImage imageNamed:@"origionalImageName.png"]; that's it
-
Naveen Chauhan over 12 yearsm getting this error after i added code like your ` Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSCFString scale]: unrecognized selector sent to instance 0x10cb04' `
-
Naveen Chauhan over 12 yearsThanks. Your code is working fine. There was some other problem with my code.
-
gauravds over 12 yearswhich one works
[imageView reloadInputViews];
or resign code