我希望开发这样的功能:在iPhone上动态设置UIImage的尺寸、宽度、高度和方向,请告诉我任何链接或开发该功能的想法。
UIImageView
://get the Image
UIImage *img = [UIImage imageNamed:@"img.png"];
//create a UIImageView
UIImageView *imageView = [[[UIImageView alloc] initWithImage:img] autorelease];
imageView.frame = CGRectMake(x, y, width, height); //set these variables as you want
我认为没有人真正理解你的问题,不过:
大小:(用自己的宽度/高度值替换)
myImageView.frame = CGRectMake(myImageView.frame.origin.x, myImageView.frame.origin.y,width,height);
方向
float angleInDegrees = 90; // change this value to what you want
float angleInRadians = angleInDegrees * (M_PI/180);
myImageView.transform = CGAffineTransformMakeRotation(angleInRadians);