ios - NSImageView ClipsToBounds -
i have ios app uses code below. creating app mac os x , same effect not seem able use clipstobounds
. should using? have rest of code working on mac, not part. thanks
var myimage = uiimage() let view = uiimageview(frame: cgrectmake(0, 0, 100, 100)) view.contentmode = uiviewcontentmode.scaleaspectfill view.layer.opacity = opacity view.layer.cornerradius = cornerradius view.clipstobounds = true view.image = self.myimage self.mainview.addsubview(view)
you should have showed cocoa code , had tried.
in case, cocoa views clip bounds default. if don't want image scaled, set imagescaling
property nsimagescalenone
.
Comments
Post a Comment