iPhone:如何动态设置UIImage的大小,宽度,高度和方向?

Nik*_*dav 4 iphone

我想开发功能,以便在iPhone中动态设置UIImage的大小,宽度,高度和方向,所以请告诉我任何链接或任何想法来开发此功能.

Aks*_*hay 9

你可以使用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
Run Code Online (Sandbox Code Playgroud)