在我的iPhone应用程序中,我用相机拍照,然后我想将其调整为290*390像素.我正在使用此方法调整图像大小:
UIImage *newImage = [image _imageScaledToSize:CGSizeMake(290, 390)
interpolationQuality:1];
Run Code Online (Sandbox Code Playgroud)
它工作得很好,但它是一个未记录的功能,所以我不能再使用iPhone OS4了.
那么...调整UIImage大小的最简单方法是什么?
当我从带有图像的视图控制器滑动到弹出手势时,在消失的视图(1px白线)中出现了一个抖动的故障.我正在使用系统滑动UIGesture.关于如何解决这个问题的任何想法?谢谢!
查看层次结构
+ Scroll View (container)
| - ContentView
| - - Header Image
| - - Title Label
| - - Author/ Date Label
| - - Post Content
Run Code Online (Sandbox Code Playgroud)
约束
|
|-[Header Image]-|
|
|-[Title Label]-|
|
|-[Author/ Date Label]-|
|
|-[Post Content]-|
|
Run Code Online (Sandbox Code Playgroud) 所以我一直试图弄清楚我现在做错了一段时间,我无法弄明白.我想要完成的是:
UIImagePickerController
UIButton
出于某种原因,每次我拍摄照片时都会在照片内失真UIButton
,看起来好像裁剪不能正常工作.这就是我的工作.在didFinishPickingMediaWithInfo
方法中我有以下代码:
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
//Copy the image to the userImage variable
[picker dismissModalViewControllerAnimated:YES];
userImage = nil;
//Rotate & resize image
userImage = [self resizeAndRotatePhoto:(UIImage *)[info objectForKey:UIImagePickerControllerOriginalImage]];
NSLog(@"Userimage size, width: %f , height: %f", userImage.size.width , userImage.size.height);
//Update the image form field with the image and set the image in the controller
NSLog(@"Button size is height: %f , width: %f" , userImageAvatarButton.frame.size.height , userImageAvatarButton.frame.size.width);
[userImageAvatarButton.layer setMasksToBounds:YES];
[userImageAvatarButton.layer setCornerRadius:3.0]; …
Run Code Online (Sandbox Code Playgroud)