标签: uiimageview

UITableViewCell右边的图像?

有没有办法将UITableViewCell.image设置为显示在单元格的右侧而不是左侧?或者我需要在单元格布局的右侧添加单独的UIImageView吗?

iphone objective-c uitableview uiimageview uiimage

46
推荐指数
4
解决办法
4万
查看次数

如何将UIImageView旋转20度?

如果我需要旋转一个,我该UIImageView怎么办?我有一个UIImage我要旋转20度.

Apple文档谈论转换矩阵,但这听起来很难.是否有任何有用的方法或功能来实现这一目标?

iphone cocoa-touch uikit uiimageview ios

46
推荐指数
4
解决办法
4万
查看次数

如何管理UIImageView内容模式?

我有一个UIImageView有一些固定的矩形.但我的图像尺寸不固定.我想根据UIImageView的rect大小显示图像.无论图像的分辨率是大还是大,它都必须根据UIImageView的大小固定显示.我很困惑使用以下资产.

UIViewContentModeScaleToFill,
UIViewContentModeScaleAspectFit,
UIViewContentModeScaleAspectFill,
UIViewContentModeRedraw
Run Code Online (Sandbox Code Playgroud)

在autoresize mask中设置什么?他们的表现如何?

iphone uiimageview ipad ios

45
推荐指数
2
解决办法
8万
查看次数

BSXPCMessage收到消息错误:连接中断

更新:参考#19285042并向苹果提交错误报告

非常奇怪的错误,没有在网上找到任何东西.它说"BSXPCMessage收到错误消息:连接中断"

我只是在做一些基本的过滤器应用程序.如果我将UIImageView.image重新分配给另一个UIImage,则只会出现错误消息.如果我只是注释掉那行,我就不会得到错误.因此,当我将过滤后的图像分配给UIImageView时,如果您能够想到出现此消息的原因,那将非常有用.

如果您能为此错误提出任何原因,我将不胜感激.

#import "FilterTestsViewController.h"

@interface FilterTestsViewController ()

@end

@implementation FilterTestsViewController

UIImage* _originalImage;
UIImage* _filterImage;
UIImageView* _uiImageView;

- (void)viewDidLoad
{
    [super viewDidLoad];
    [self initialize];
    //flip image by 180*

}

-(void)initialize
{
    _originalImage = [UIImage imageNamed:@"ja.jpg"]; //creates image from file, this will result in a nil CIImage but a valid CGImage;
    [self createFilterImage];
    _uiImageView = [[UIImageView alloc] initWithImage:_filterImage]; //creates a UIImageView with the UIImage
    [self.view addSubview:_uiImageView]; //adds the UIImageView to view;
}

-(void)createFilterImage
{
    NSString* filterName = @"CIFalseColor";
    CIImage* ciImage …
Run Code Online (Sandbox Code Playgroud)

xcode objective-c uiimageview ios xcode6

45
推荐指数
2
解决办法
2万
查看次数

iPhone:相机预览叠加

如何UIImageView在相机预览中添加叠加()并处理此操作?

我之前尝试这样做(例如使用UIImagePickerController并将图像添加为子视图)失败了.

iphone camera uiimageview uiimagepickercontroller

43
推荐指数
3
解决办法
3万
查看次数

在iOS设备上本地存储图像

一些iOS照片相关应用程序存储使用应用程序创建的图像,而不是照片库.例如,Fat Booth显示了在应用启动时使用该应用创建的滚动列表.请注意,这些照片会在用户明确将其保存到照片库时保留.在iOS应用程序中保存和保存图像的最简单方法是什么?

我熟悉的唯一持久存储是NSUserDefaults和密钥链.但是我从来没有听说过这些用来存储大量数据,比如图像.现在我想知道核心数据是否是最简单的方法.

objective-c uiimageview uiimage nsfilemanager ios

43
推荐指数
3
解决办法
4万
查看次数

UIImage方面适合并对齐顶部

aspect fit默认情况下,它看起来像是将图像对齐到帧的底部.有没有办法在保持完整的同时覆盖对齐aspect fit

**编辑**

这个问题早于自动布局.事实上,在问到这个问题的同一周,WWDC 2012正在展示自动布局

cocoa uiimageview ios aspect-fit

42
推荐指数
4
解决办法
4万
查看次数

在CALayer中添加UIImage

我必须添加一个UIImageView作为MapView的子视图.为此,我在MapView上创建了一个图层.在这一层,我想放置我的图像,但我得到一个白色的矩形,没有别的.我的图片不可见.

这是代码:

- (void)viewDidLoad
{
    //......

    CALayer *layer = [CALayer layer];
    layer.backgroundColor = [[UIColor whiteColor] CGColor];

    if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
    {
        layer.bounds = CGRectMake(self.mapView.bounds.origin.x,
                                  self.mapView.bounds.origin.y, 80, 300);
    }
    else
    {
        layer.bounds = CGRectMake(self.mapView.frame.origin.x,
                                  self.mapView.frame.origin.y, 150, 700);
    }

    layer.contents = (id)[UIImage imageNamed:@"myImage.png"];
    //the name is correct but  in the output the image is not visible

    [[self.mapView layer] addSublayer:layer];
    [layer setNeedsDisplay];
}
Run Code Online (Sandbox Code Playgroud)

subview calayer uiimageview uiimage ios

40
推荐指数
3
解决办法
4万
查看次数

创建一条水平线

我有两个堆叠的标签.如果我想在它们之间使用水平线,除了使用带有UIImageView的图像之外还有其他方法吗?

iphone cocoa-touch uiimageview uiimage

39
推荐指数
4
解决办法
3万
查看次数

保存UIImage,以错误的方向加载它

我使用以下代码来保存和加载我从库中选择的图像或使用相机:

//saving an image
- (void)saveImage:(UIImage*)image:(NSString*)imageName {
    NSData *imageData = UIImagePNGRepresentation(image); //convert image into .png format.
    NSFileManager *fileManager = [NSFileManager defaultManager];//create instance of NSFileManager
    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); //create an array and store result of our search for the documents directory in it
    NSString *documentsDirectory = [paths objectAtIndex:0]; //create NSString object, that holds our exact path to the documents directory
    NSString *fullPath = [documentsDirectory stringByAppendingPathComponent:[NSString stringWithFormat:@"%@.png", imageName]]; //add our image to the path
    [fileManager createFileAtPath:fullPath contents:imageData attributes:nil]; //finally …
Run Code Online (Sandbox Code Playgroud)

iphone objective-c orientation uiimageview ipad

39
推荐指数
2
解决办法
2万
查看次数