相关疑难解决方法(0)

调整UIImage大小的最简单方法是什么?

在我的iPhone应用程序中,我用相机拍照,然后我想将其调整为290*390像素.我正在使用此方法调整图像大小:

UIImage *newImage = [image _imageScaledToSize:CGSizeMake(290, 390)
                         interpolationQuality:1];    
Run Code Online (Sandbox Code Playgroud)

它工作得很好,但它是一个未记录的功能,所以我不能再使用iPhone OS4了.

那么...调整UIImage大小的最简单方法是什么?

resize uiimage ios

381
推荐指数
24
解决办法
30万
查看次数

滑动到弹出会使图像抖动

当我从带有图像的视图控制器滑动到弹出手势时,在消失的视图(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)

uiviewcontroller ios swift

14
推荐指数
1
解决办法
241
查看次数

UIImage调整大小不正常

所以我一直试图弄清楚我现在做错了一段时间,我无法弄明白.我想要完成的是:

  1. 拍张照片 UIImagePickerController
  2. 拍摄照片并从顶部和底部裁剪,使其成为正方形(类似于Instagram)
  3. 在a中显示该图像 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)

cocoa-touch objective-c ios4 ios ios5

8
推荐指数
1
解决办法
6350
查看次数

标签 统计

ios ×3

cocoa-touch ×1

ios4 ×1

ios5 ×1

objective-c ×1

resize ×1

swift ×1

uiimage ×1

uiviewcontroller ×1