iOS Swift - UIImageView can't set ContentMode -
i'm using cifilter add filter image. resulted image after filtering image has size: cgrectmake(10, 10, 70, 70)
. can't set resulted image content mode scaleaspectfill
. here code:
filter2image.frame = cgrectmake(90, 10, 70, 70) let filter2data = cifilter(name: "ciphotoeffectchrome") filter2data.setvalue(ciimage(image: imageview.image), forkey: kciinputimagekey) self.filter2image.image = uiimage(ciimage: filter2data.outputimage) filter2image.contentmode = uiviewcontentmode.scaleaspectfill
try changing frame after set contentmode. this:
let filter2data = cifilter(name: "ciphotoeffectchrome") filter2data.setvalue(ciimage(image: imageview.image), forkey: kciinputimagekey) self.filter2image.image = uiimage(ciimage: filter2data.outputimage) filter2image.contentmode = uiviewcontentmode.scaleaspectfill filter2image.frame = cgrectmake(90, 10, 70, 70)
Comments
Post a Comment