相关疑难解决方法(0)

UITableView中的cell imageView直到被选中才会出现

  1. 这是一个问题的视频:http://youtu.be/Jid0PO2HgcU

  2. 尝试从资产库中为UITableView中的[cell imageView]设置图像时出现问题.

图像已加载但在触摸(选择)该单元格之前不会出现在单元格中.这是我的代码设置单元格的imageView:

//Start loading the image using the image path
NSString *path = [occasion imagePath];

if (path != nil && [path hasPrefix:@"ass"])
{
NSLog(@"photo loaded from assets library");
//testing ALAssestLibrary
ALAssetsLibrary* assetsLibrary = [[ALAssetsLibrary alloc] init];

ALAssetsLibraryAssetForURLResultBlock resultsBlock = ^(ALAsset *asset)
{
    ALAssetRepresentation *representation = [asset defaultRepresentation];
    CGImageRef imageRef = [representation fullResolutionImage]; 
    UIImage *image = [[UIImage alloc] initWithCGImage:imageRef];


    [[cell imageView] setImage:[image imageByScalingAndCroppingForSize:CGSizeMake(36.0, 42.0)]];     

    [image release];
};
ALAssetsLibraryAccessFailureBlock failureBlock = ^(NSError *error){

    NSLog(@"FAILED! due to error in domain …
Run Code Online (Sandbox Code Playgroud)

assets uitableview imageview ios

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

标签 统计

assets ×1

imageview ×1

ios ×1

uitableview ×1