1、压缩图片:UIImage *yourImage= [self imageWithImageSimple:image scaledToSize:CGSizeMake(210.0, 210.0)];
- (UIImage*)imageWithImageSimple:(UIImage*)image scaledToSize:(CGSize)newSize { // Create a graphics image context UIGraphicsBeginImageContext(newSize); // Tell the old image to draw in this newcontext, with the desired // new size [image drawInRect:CGRectMake(0,0,newSize.width,newSize.height)]; // Get the new image from the context UIImage* newImage = UIGraphicsGetImageFromCurrentImageContext(); // End the context UIGraphicsEndImageContext(); // Return the new image. return newImage; }
NSString * encodedString = (NSString *)CFURLCreateStringByAddingPercentEscapes (NULL, (CFStringRef)yourtext, NULL, (CFStringRef)@”!*’();:@&=+$,/?%#[]“, kCFStringEncodingUTF8);
self.navigationController.navigationBarHidden = YES;
4、imageView加载图片
UIImage *myImage = [UIImage imageNamed:@"1.jpg"]; [imageView setImage:myImage]; [self.view addSubview:imageView];
#import<QuartzCore/QuartzCore.h> [self.view.layer removeAllAnimations];
[cell.contentView viewWithTag:tag];