github_s2339956

github_s2339956

关注

0 粉丝,0 关注,10 积分

github_s2339956 于 1 年前加入swiftmi


github_s2339956最近创建的主题


github_s2339956 最近回复了


回复了 suzee 创建的主题: swift中怎么获取网络图片后,根据图片大小对view视图大小进行调整, 4 个月前

func resizeImage(image:UIImage, targetSize:CGSize) -> UIImage{ let newRect:CGRect = CGRectMake(0, 0, targetSize.width, targetSize.height) UIGraphicsBeginImageContextWithOptions(targetSize, false, 1.0) image.drawInRect(newRect) let newImage = UIGraphicsGetImageFromCurrentImageContext() UIGraphicsEndImageContext() return newImage! }