繪製圖片到指定的區域切不變形web
image是個UIImage類型圖片
[image drawInRect:CGRectMake(10, 50, 300, 450)];ip
或者:it
UIImageView *webImgV = [[UIImageView alloc] initWithFrame:CGRectMake(5, 5, 80, 30)];cli
[webImgV setContentScaleFactor:[[UIScreen mainScreen] scale]];
webImgV.contentMode = UIViewContentModeScaleAspectFill;
webImgV.autoresizingMask = UIViewAutoresizingFlexibleHeight;
webImgV.clipsToBounds = YES;im