I have this code:
...
NSData * dimage = [[NSData alloc]initWithData:[datosImagen objectForKey:@"Image"]];
UIImage * imagenAMostrar = [[UIImage alloc] initWithData:dimage];
UIImageView * imAMostrar = [[UIImageView alloc] initWithImage:imagenAMostrar];
...
I need resize my UIImageView, similar to this dimensions: setFrame:CGRectMake(0,60,320,240).
but for this i need UIImageView size….
NSLog(@" Image width:%d",imagenAMostrar.size.width);
NSLog(@" Image height:%d",imagenAMostrar.size.height);
The result is:
2011-10-03 13:32:28.993 Catalogo-V1[2679:207] Image width:0
2011-10-03 13:32:28.994 Catalogo-V1[2679:207] Image height:0
Why??
Didn’t you get any warnings in NSLog statements? You should be getting a conversion type warnings.
widthandheightarefloat-s. You are supposed to use%fas conversion specifier. You should be printing them like this,You can set the frame of image view like this,